Active Client Selection algorithms of Federated Learning implementations by PyTorch in my Thesis.
torch=1.8.0
torchvision
numpy
scipy
tqdm
h5py
python main.py --method {client selection method you want}
Random
: Random SelectionAFL
: Active Federated Learning [Jack Goetz et al., 2019]Pow-d
: Power-of-d-Choice [Yae Jee Cho et al., 2022]Cluster1
: Clustered Sampling 1 [Yann Fraboni et al., 2021]Cluster2
: Clustered Sampling 2 [Yann Fraboni et al., 2021]DivFL
: Diverse Client Selection for FL [Ravikumar Balakrishnan et al., 2022]
-
FederatedEMNIST (default)
Download from this [link] and place them in your data directory
data_dir
.python src/main.py --dataset FederatedEMNIST --model CNN -A 10 -K 3400 --lr_local 0.1 -B 20 -R 2000
-
CelebA
Download from the original CelebA homepage [link].
python src/main.py --dataset CelebA --model CNN -A 10 -K 9343 --lr_local 0.005 -B 5 -R 100
-
FederatedCIFAR100
Download from this [link].
python src/main.py --dataset FedCIFAR100 --model ResNet -A 10 -K 500 --lr_local 0.1 -B 20 -R 4000
-
FederatedCIFAR10 (Partitioned by Dirichlet distribution, followed by Clustered Sampling)
Don't need to download any dataset.
python src/main.py --dataset PartitionedCIFAR10 --model CNN -A 10 -K 100 --lr_local 0.001 -B 50 -R 1000
-
Reddit
python src/main.py --dataset Reddit --model BLSTM -A 200 -K 7527 --maxlen 400 \ --alpha1 0.75 --alpha2 0.01 --alpha3 0.1 \ --lr_local 0.01 --lr_global 0.001 -E 2 -B 128 -R 100
- TODO: reproducible performance