manager#
Module Contents#
Base class for ClientManager. |
|
Passive communication |
|
Active communication |
- class ClientManager(network, trainer)#
Bases:
fedlab.core.network_manager.NetworkManager
Base class for ClientManager.
ClientManager
defines client activation for different communication stages.- Parameters
network (DistNetwork) – Network configuration.
trainer (ClientTrainer) – Subclass of
ClientTrainer
. Providestrain()
andmodel
. Define local client training procedure.
- setup(self)#
Initialization stage.
ClientManager
reports number of clients simulated by current client process.
- class ClientPassiveManager(network, trainer, logger=Logger())#
Bases:
ClientManager
Passive communication
NetworkManager
for client in synchronous FL pattern.- Parameters
network (DistNetwork) – network configuration.
trainer (ClientTrainer) – Subclass of
ClientTrainer
. Providestrain()
andmodel
. Define local client training procedure.logger (Logger) – 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 local model with server
- class ClientActiveManager(network, trainer, logger=Logger())#
Bases:
ClientManager
Active communication
NetworkManager
for client in asynchronous FL pattern.- Parameters
network (DistNetwork) – network configuration.
trainer (ClientTrainer) – Subclass of
ClientTrainer
. Providestrain()
andmodel
. 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 (ACTIVE)
after receiving data, client will train local model
client will synchronize with server actively
- synchronize(self)#
Synchronize local model with server