This is the code-implementation for the paper Collaborative learning via Prediction Consensus
conda env create -f env.yml
conda activate collab-consensus
Supported datasets:
Cifar10/100
FedISIC2019
Go to datasets
folder. For cifar10/100
, dirichlet (FedISIC2019
dataset, each split corresponds to data collected by different hospitals.
python3 generate_cifar100.py --niid --partition dir --alpha [a] --n_clients [n] --refgen
By default, models are trained with 50 gloabl rounds and 5 local rounds each. Here we offer different combinations for training:
- Setting:
- Normal
- Clients are assigned with two different model architectures
- Clients with low quality data involved
- Trust weight update:
- dynamic
- static (fixed as first trust calculation throughout training)
- naive (fixed as 1/N each entry throughout training)
python3 main.py -ds [Cifar10/Cifar100/] -ncl [10] -lam [0.5/0.0] -setting [normal/2sets/evil] -trust [dynamic/static/naive]