flip.utils ========== .. py:module:: flip.utils .. autoapi-nested-parse:: 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 ---------- .. toctree:: :maxdepth: 1 /reference/api/flip/utils/model_weights_handling/index /reference/api/flip/utils/utils/index Classes ------- .. autoapisummary:: flip.utils.Utils Functions --------- .. autoapisummary:: flip.utils.get_model_weights_diff Package Contents ---------------- .. py:function:: get_model_weights_diff(original_weights: collections.OrderedDict, new_weights: collections.OrderedDict, iterations: int) -> nvflare.apis.dxo.DXO Compute the weights differences to send a weight update. :param original_weights: weights coming from the server (before training) :type original_weights: OrderedDict :param new_weights: weights coming out of the server (post training) :type new_weights: OrderedDict :param iterations: number of iterations :type iterations: int :returns: *DXO* -- DXO containing the weight updates for the server. .. py:class:: Utils Utility class with static helper methods. .. py:method:: is_valid_uuid(val) -> bool :staticmethod: Check if a value is a valid UUID. :param val: Value to check (will be converted to string) :returns: *bool* -- True if valid UUID, False otherwise .. py:method:: is_string_empty(val: str) -> bool :staticmethod: Check if a string is empty or contains only whitespace. :param val: String to check :returns: *bool* -- True if empty or whitespace-only, False otherwise