qfedavg#
Module Contents#
qFedAvg server handler. |
|
Federated client with modified upload package and local SGD solver. |
- class qFedAvgServerHandler(model: torch.nn.Module, global_round: int, num_clients: int = 0, sample_ratio: float = 1, cuda: bool = False, device: str = None, sampler: fedlab.contrib.client_sampler.base_sampler.FedSampler = None, logger: fedlab.utils.Logger = None)#
Bases:
fedlab.contrib.algorithm.basic_server.SyncServerHandler
qFedAvg server handler.
- global_update(buffer)#
- class qFedAvgClientTrainer(model: torch.nn.Module, cuda: bool = False, device: str = None, logger: fedlab.utils.Logger = None)#
Bases:
fedlab.contrib.algorithm.basic_client.SGDClientTrainer
Federated client with modified upload package and local SGD solver.
- property uplink_package#
Return a tensor list for uploading to server.
This attribute will be called by client manager. Customize it for new algorithms.
- setup_optim(epochs, batch_size, lr, q)#
Set up local optimization configuration.