lib.sedna.algorithms.aggregation.aggregation

Aggregation algorithms

Module Contents

Classes

AggClient

Client that interacts with cloud aggregator

FedAvg

Federated averaging algorithm

class lib.sedna.algorithms.aggregation.aggregation.AggClient[source]

Client that interacts with cloud aggregator

Parameters
  • num_samples (int) – number of samples for the current weights

  • weights (List) – weights of the layer as a list of number-like array, such as [[0, 0, 0, 0], [0, 0, 0, 0] … ]

num_samples :int[source]
weights :List[source]
class lib.sedna.algorithms.aggregation.aggregation.FedAvg[source]

Bases: BaseAggregation, abc.ABC

Federated averaging algorithm

aggregate(self, clients: List[AggClient])[source]

Calculate the average weight according to the number of samples

Parameters

clients (List) – All clients in federated learning job

Returns

update_weights – final weights use to update model layer

Return type

Array-like