p2pfl.learning.aggregators.fedavg moduleΒΆ

Federated Averaging (FedAvg) Aggregator.

class p2pfl.learning.aggregators.fedavg.FedAvg(node_name='unknown')[source]ΒΆ

Bases: Aggregator

Federated Averaging (FedAvg) [McMahan et al., 2016].

Paper: https://arxiv.org/abs/1602.05629.

aggregate(models)[source]ΒΆ

Aggregate the models.

Parameters:

models (List[P2PFLModel]) – Dictionary with the models (node: model,num_samples).

Return type:

P2PFLModel

Returns:

A P2PFLModel with the aggregated.