FedRep
¶
Implementation of the [FedRep21] algorithm.
References
[FedRep21]
Liam Collins, Hamed Hassani, Aryan Mokhtari, and Sanjay Shakkottai. Exploiting shared representations for personalized federated learning. In ICML (2021). URL: https://arxiv.org/abs/2102.07078
Classes included in fluke.algorithms.fedrep
Classes¶
- class fluke.algorithms.fedrep.FedRepClient(index: int, model: EncoderHeadNet, train_set: FastDataLoader, test_set: FastDataLoader, optimizer_cfg: OptimizerConfigurator, loss_fn: Module, local_epochs: int = 3, fine_tuning_epochs: int = 0, clipping: float = 0, tau: int = 3, **kwargs)[source]¶
Bases:
Client
- property pers_optimizer: Optimizer¶
Optimizers for the personalized part of the model.
- Returns:
Optimizer for the personalized part of the model.
- Return type:
- property pers_scheduler: <module 'torch.optim.lr_scheduler' from '/opt/hostedtoolcache/Python/3.12.10/x64/lib/python3.12/site-packages/torch/optim/lr_scheduler.py'>¶
Learning rate scheduler for the personalized part of the model.
- Returns:
- Learning rate scheduler for the personalized part of the
model.
- Return type:
torch.optim.lr_scheduler
- class fluke.algorithms.fedrep.FedRepServer(model: Module, test_set: FastDataLoader, clients: Collection[Client], weighted: bool = False)[source]¶
Bases:
Server
- class fluke.algorithms.fedrep.FedRep(n_clients: int, data_splitter: DataSplitter, hyper_params: DDict | dict[str, Any], **kwargs)[source]¶
Bases:
CentralizedFL