This repository is created to experiment easily in parallel for the state of the art methods in Federated Learning. It also includes the implementation of How to Combine Variational Bayesian Networks in Federated Learning in Pytorch. Please cite the paper if you benefit from this framework. For further details, contact buldu19@itu.edu.tr or ozera17@itu.edu.tr.
- SCAFFOLD
- FedProx
- FedAvg
- FedNova
- BFLAvg (Ours)
You can install the requirements for this project by using requirements.txt
$ conda install --file requirements.txtThe dataset is automatically downloaded and prepared by the code when first time running the experiment. For precaching the dataset, you can run the following command:
| FMNIST | ||||
| Cifar-10 | ||||
| SVHN |
$ python utils/data/data_downloader.pyWe inherited the non-IID data generation methods from Federated Learning on Non-IID Data Silos: An Experimental Study. You can run the following experiments:
| Experiment | Description |
|---|---|
| IID | IID data generation for 10 clients |
| IID-500 | IID data generation for 100 clients |
| noniid-labeldir | Non-IID data generation for 10 clients with dirichlet distribution |
| noniid-labeldir-500 | Non-IID data generation for 100 clients with dirichlet distribution |
| noniid-label[1:4] | Non-IID data generation for 10 clients with selection of how many class each client have (choices: 1, 2, 3, 4) |
| iid-diff-quantity | IID data generation for 10 clients with different quantity of data |
| iid-diff-quantity-500 | IID data generation for 100 clients with different quantity of data |
You can run the experiments by using the following command:
python train.py \
--dataset=cifar10 \
--alg=BFLAVG \
--experiment=noniid-labeldir \
--device='cuda:0'\
--process=5 \
--datadir='./data/' \
--logdir='./logs/' \
--init_seed=0| Parameter | Description |
|---|---|
| dataset | Dataset name: cifar10, fmnist, kmnist, cifar100, svhn, covertype |
| alg | Algorithm name: BFL, BFLAVG, Fed, FedAVG, FedProx, FedNova, Scaffold |
| experiment | Experiment name: noniid-labeldir[-500], iid[-500], noniid-label[1:4], iid-dif-quantity[-500] |
| device | Device name: cuda:0, cpu |
| process | Number of processes for multiprocessing |
| datadir | Data directory path |
| logdir | Log directory path |
| init_seed | Initial seed number for the experiment |
| desc | Description of the experiment |
Runtime comparison results based on the number of processes of IID partitioned 100 clients experiment with means
| FED |
|
|
|
|
| FEDAVG |
|
|
|
|
| FVBA |
|
|
|
|
|
|
|
|
||
|
|
|
|
||
|
|
|
|
||
|
|
|
|
||
| FVBWA |
|
|
|
|
|
|
|
|
||
|
|
|
|
||
|
|
|
|
||
|
|
|
|
@article{ozer2022combine,
title={How to Combine Variational Bayesian Networks in Federated Learning},
author={Ozer, Atahan and Buldu, Kadir Burak and Akg{\"u}l, Abdullah and Unal, Gozde},
journal={arXiv preprint arXiv:2206.10897},
year={2022}
}| Name | Github | |
|---|---|---|
| Kadir Burak Buldu | buldu19@itu.edu.tr | buldubu |
| Atahan Özer | ozera17@itu.edu.tr | TrubadurOsman |
| Abdullah Akgül | akgula15@itu.edu.tr | aportekila |
| Gozde Unal | gozde.unal@itu.edu.tr | gozde-unal |