Common#

Used to specify requirements for the aggregation functionality to run.

fma_core.algorithms.requirements.common.all_clients(model, model_updates)#

Requires all clients to push update before aggregation is executed.

Parameters:
  • model (task_queue_base.models.FederatedModel) – Database FederatedModel object

  • model_updates (task_queue_base.models.ModelUpdate) – Database objects containing the original weights used to initialize the shape of the layers

Returns:

A boolean assertion that indicates if all clients have pushed updates

Return type:

bool

fma_core.algorithms.requirements.common.require_x_updates(model, model_updates, x)#

Requires x clients to push update before aggregation is executed.

Parameters:
  • model (task_queue_base.models.FederatedModel) – Database FederatedModel object

  • model_updates (task_queue_base.models.ModelUpdate) – Database objects containing the original weights used to initialize the shape of the layers

  • x (int) – The number of client updates needed

Returns:

A boolean assertion that indicates if x clients have pushed updates

Return type:

bool