5.1.1.8.1.1. FedEval.strategy.FedAvg
5.1.1.8.1.1.1. Module Contents
5.1.1.8.1.1.1.1. Classes
the basic class of federated strategies. |
|
the basic class of federated strategies. |
- class FedEval.strategy.FedAvg.FedAvg(*args, **kwargs)
Bases:
FedEval.strategy.FederatedStrategy.FedStrategythe basic class of federated strategies.
- host_select_train_clients(ready_clients)
select clients from the given ones for training purpose.
- Parameters:
ready_clients (List[ClientId]) – the id list of clients that are ready for training.
- Raises:
NotImplementedError – raised when called but not overriden.
- Returns:
the id list of the selected clients.
- Return type:
List[ClientId]
- host_select_evaluate_clients(ready_clients)
select clients from the given ones for evaluation purpose.
- Parameters:
ready_clients (List[ClientId]) – the id list of clients that are ready for evaluaion.
- Raises:
NotImplementedError – raised when called but not overriden.
- Returns:
the id list of the selected clients.
- Return type:
List[ClientId]
- class FedEval.strategy.FedAvg.FedSGD(*args, **kwargs)
Bases:
FedAvgthe basic class of federated strategies.
- compute_gradients(x, y)
- host_select_train_clients(ready_clients)
select clients from the given ones for training purpose.
- Parameters:
ready_clients (List[ClientId]) – the id list of clients that are ready for training.
- Raises:
NotImplementedError – raised when called but not overriden.
- Returns:
the id list of the selected clients.
- Return type:
List[ClientId]
- host_select_evaluate_clients(ready_clients)
select clients from the given ones for evaluation purpose.
- Parameters:
ready_clients (List[ClientId]) – the id list of clients that are ready for evaluaion.
- Raises:
NotImplementedError – raised when called but not overriden.
- Returns:
the id list of the selected clients.
- Return type:
List[ClientId]
- fit_on_local_data()
fit model with local data at client side.
Called by the selected clients.
- Raises:
NotImplementedError – raised when called but not overriden.
- Returns:
TODO(fgh)