Skip to content

fedopt_server

FedoptServer(num_clients, total_epoch, opt)

Bases: strategy_server.StrategyServer

Implement the strategy of fedopt on server side.

Attributes:

Name Type Description
num_clients int

client number

total_epoch int

the epoch number of client trainning

opt FedOpt

the FedOpt method, which is in FedAdam, FedAdagrad, FedYogi or FedAvgM

Source code in iflearner/business/homo/strategy/fedopt_server.py
def __init__(
    self,
    num_clients: int,
    total_epoch: int,
    opt: FedOpt,
) -> None:
    super().__init__(num_clients, total_epoch)

    self._opt = opt

    logger.info(f"num_clients: {self._num_clients}, opt: {type(opt).__name__}")