This implemetation is based on Python3. To run the code, you need the following dependencies:
-
torch==1.9.0
-
scipy==1.7.2
-
numpy==1.21.2
-
sklearn==1.0.1
-
matplotlib==3.5.3
-
pandas==1.3.4
-
mpi4py==3.1.1
You can simply run
pip install -r requirements.txt
We select some important files for detailed description.
|-- LightFed # experiments for baselines, FedMD-CG and datasets
|-- experiments/
|-- datasets/
|-- data_distributer.py/ # the load datasets,including MNIST, EMNIST, FMNSIT and CIFAR-10
|-- horizontal/ ## FedMD-CG and baselines
|-- fedavg/
|-- FedCG/
|-- fedgen/
|-- FedMD-CG/
|-- Fedper/
|-- LG-Fedavg/
|-- localtrain/
|-- models
|-- model.py/ ##load backnone architectures
|-- lightfed/
|-- core # important configure
|-- tools
- Entering the FedMD-CG
cd LightFed
cd experiments
5A17
span>
cd horizontal
cd FedMD-CG
- You can run any models implemented in
main_FedMDCG.py
. For examples, you can run our model onFMNIST
dataset by the script:
python main_FedMDCG.py --data_partition_mode non_iid_dirichlet_balanced --non_iid_alpha 10 --client_num 10 --seed 0 --model_type Lenet --data_set FMNIST
And you can run other baselines, such as
cd LightFed
cd experiments
cd horizontal
cd fedavg
python main_fedavg.py --data_partition_mode non_iid_dirichlet_balanced --non_iid_alpha 10 --client_num 10 --seed 0 --model_type Lenet --data_set FMNIST