5.1.1.8.1.9. FedEval.strategy.MFedAvg

5.1.1.8.1.9.1. Module Contents

5.1.1.8.1.9.1.1. Classes

MFedAvg

the basic class of federated strategies.

MFedSGD

the basic class of federated strategies.

class FedEval.strategy.MFedAvg.MFedAvg(**kwargs)

Bases: FedEval.strategy.FedAvg.FedAvg

the basic class of federated strategies.

update_host_params(client_params, aggregate_weights)

update central server’s model params/weights with the aggregated params received from clients.

Parameters:
  • client_params (Iterable[ModelWeights]) – the weights form different clients, ordered like [params1, params2, …]

  • aggregate_weights (Iterable[Union[float, int]]) – aggregate weights of different clients, usually set according to the clients’ training sample size. E.g., A, B, and C have 10, 20, and 30 images, then the aggregate_weights can be [1/6, 1/3, 1/2] or [10, 20, 30].

Raises:

NotImplementedError – raised when called but not overriden.

class FedEval.strategy.MFedAvg.MFedSGD(**kwargs)

Bases: MFedAvg

the basic class of federated strategies.