This repo is the implementation of paper FedMix: Approximation of Mixup under Mean Augmented Federated Learning
conf.py
: configuration filedata
: directory containing datafedavg
client.py
datasets.py
models.py
server.py
main.py
: the main procedureutils.py
: utility codes
-
clinical
dataset is provided in this repo as an example. If you want to train on your own data, please organize it after the following form:data ├── clinical │ ├── clinical_test.csv │ ├── beta0.05 │ │ ├── clinical_node_0.csv │ │ ├── clinical_node_1.csv │ │ ├── clinical_node_2.csv │ │ ├── clinical_node_3.csv │ │ └── clinical_node_4.csv │ ├── beta0.5 │ └── ... └── ...
where
clinical_test.csv
is the test set andclinical_node_{i}.csv
is the training set in the i'th client.beta0.05
indicates that the training data are partitioned following a Dirichlet distribution with parameter equals to 0.05. -
Edit the configuration file
conf.py
. Some important arguments are:global_epochs
: number of global epochslocal_epochs
: number of local epochsbeta
: parameter of Dirichlet distributionmean_batch
: number of instances used in computing the average in FedMixlambda
: coefficient in loss of FedMixlr
,momentum
: optimizer settingsnum_parties
: number of parties (clients)- ...
-
Start training:
python main.py
The best models will be saved in
./save_model/
after training.