Code to reproduce experiments in ICLR 2023 paper https://arxiv.org/abs/2301.09604.
Requirements can be found in the requirements.txt file.
- An example command to run an experiment is as follows:
python main.py --seed 0 --algorithm "fedavg" --dataset "CIFAR10" --model "resnet18" --num_clients 100 --num_participating_clients 5 --num_rounds 500 --alpha 0.5
Explanation of arguments:
-
seed
: Choice of seed to fix randomness in experiment. -
algorithm
: Choice of algorithm. Possible options arefedavg
,fedexp
,scaffold
,scaffold(exp)
,fedprox
,fedprox(exp)
,fedadam
,fedadagrad
,fedavgm
,fedavgm(exp)
. -
dataset
: Choice of dataset. Possible options areCIFAR10
,CIFAR100
,CINIC10
. -
model
: Choice of neural network model. Possible options areresnet18
,CNN
(for CIFAR dataset),EMNIST_CNN
(for EMNIST dataset). -
num_clients
: Total number of clients in FL system. -
num_participating_clients
: Number of clients that participate in each round of FL training. -
num_rounds
: Number of rounds of FL training -
alpha
: Choice of alpha parameter for the Dirichlet distribution used to create heterogeneity in the client datasets for CIFAR and CINIC datasets.
Details of these arguments to reproduce our experiments can be found in Section 6 of the paper and Appendices D.2 and D.3.
Code for the synthetic linear regression experiment can be found in linear_regression.ipynb