manager#
Module Contents#
Base class for ClientManager. |
|
Passive communication |
|
Active communication |
- class ClientManager(network, trainer)#
Bases:
fedlab.core.network_manager.NetworkManagerBase class for ClientManager.
ClientManagerdefines client activation in different communication stages.- Parameters
network (DistNetwork) – Network configuration and interfaces.
trainer (ClientTrainer) – Subclass of
ClientTrainer. Provideslocal_process()anduplink_package. Define local client training procedure.
- setup(self)#
Initialization stage.
ClientManagerreports number of clients simulated by current client process.
- class PassiveClientManager(network, trainer, logger=None)#
Bases:
ClientManagerPassive communication
NetworkManagerfor client in synchronous FL pattern.- Parameters
network (DistNetwork) – Network configuration and interfaces.
trainer (ClientTrainer) – Subclass of
ClientTrainer. Provideslocal_process()anduplink_package. Define local client training procedure.logger (Logger, optional) – Object of
Logger.
- main_loop(self)#
Actions to perform when receiving a new message, including local training.
- Main procedure of each client:
client waits for data from server (PASSIVELY).
after receiving data, client start local model training procedure.
client synchronizes with server actively.
- synchronize(self)#
Synchronize with server
- class ActiveClientManager(network, trainer, logger=None)#
Bases:
ClientManagerActive communication
NetworkManagerfor client in asynchronous FL pattern.- Parameters
network (DistNetwork) – Network configuration and interfaces.
trainer (ClientTrainer) – Subclass of
ClientTrainer. Provideslocal_process()anduplink_package. Define local client training procedure.logger (Logger, optional) – Object of
Logger.
- main_loop(self)#
Actions to perform on receiving new message, including local training
client requests data from server (ACTIVELY).
after receiving data, client will train local model.
client will synchronize with server actively.
- request(self)#
Client request
- synchronize(self)#
Synchronize with server