flip.utils

FLIP Utilities module containing helper functions.

Exports:
  • Utils: Utility class with static helper methods

  • get_model_weights_diff: Compute weight differences for federated updates

Submodules

Classes

Utils

Utility class with static helper methods.

Functions

get_model_weights_diff(→ nvflare.apis.dxo.DXO)

Compute the weights differences to send a weight update.

Package Contents

flip.utils.get_model_weights_diff(original_weights: collections.OrderedDict, new_weights: collections.OrderedDict, iterations: int) nvflare.apis.dxo.DXO[source]

Compute the weights differences to send a weight update.

Parameters:
  • original_weights (OrderedDict) – weights coming from the server (before training)

  • new_weights (OrderedDict) – weights coming out of the server (post training)

  • iterations (int) – number of iterations

Returns:

DXO – DXO containing the weight updates for the server.

class flip.utils.Utils[source]

Utility class with static helper methods.

static is_valid_uuid(val) bool[source]

Check if a value is a valid UUID.

Parameters:

val – Value to check (will be converted to string)

Returns:

bool – True if valid UUID, False otherwise

static is_string_empty(val: str) bool[source]

Check if a string is empty or contains only whitespace.

Parameters:

val – String to check

Returns:

bool – True if empty or whitespace-only, False otherwise