lib.sedna.algorithms.aggregation
¶
Submodules¶
Package Contents¶
Classes¶
Federated averaging algorithm |
|
Abstract class of aggregator |
|
Client that interacts with cloud aggregator |
|
Abstract class of aggregator |
- class lib.sedna.algorithms.aggregation.FedAvg[source]¶
Bases:
BaseAggregation
,abc.ABC
Federated averaging algorithm
- class lib.sedna.algorithms.aggregation.MistNet(cut_layer, epsilon=100)[source]¶
Bases:
BaseAggregation
,abc.ABC
Abstract class of aggregator
- aggregate(clients: List[AggClient])[source]¶
Some algorithms can be aggregated in sequence, but some can be calculated only after all aggregated data is uploaded. therefore, this abstractmethod should consider that all weights are uploaded.
- Parameters:
clients (List) – All clients in federated learning job
- Returns:
final weights use to update model layer
- Return type:
Array-like
- class lib.sedna.algorithms.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¶
- weights: List¶
- class lib.sedna.algorithms.aggregation.FedAvgV2[source]¶
Bases:
BaseAggregation
,abc.ABC
Abstract class of aggregator
- aggregate(clients: List[AggClient])[source]¶
Some algorithms can be aggregated in sequence, but some can be calculated only after all aggregated data is uploaded. therefore, this abstractmethod should consider that all weights are uploaded.
- Parameters:
clients (List) – All clients in federated learning job
- Returns:
final weights use to update model layer
- Return type:
Array-like