This is the code for the paper [Novel clustered federated learning based on local loss] (to add link).
The code is based on a simulation framework for federated learning fl-sim.
To install requirements:
pip install -r requirements.txt
One can use the code in a Jupyter notebook or in command line as follows:
fl-sim configs/lcfl-rot-mnist.yml
or run in background using:
mkdir -p .logs
nohup fl-sim configs/lcfl-rot-mnist.yml > .logs/lcfl-rot-mnist.log 2>&1 & echo $! > .logs/lcfl-rot-mnist.pid
One can use the Panel
widget to inspect the results in a Jupyter notebook:
%load_ext autoreload
%autoreload 2
from fl_sim.utils.viz import Panel
panel = Panel()
ALL experiments were repeated 5 times with different random seeds.
1200 clients - ACC | 1200 clients - loss |
---|---|
2400 clients - ACC | 2400 clients - loss |
dynamic transforms - ACC | dynamic transforms - loss |
---|---|
no transforms - ACC | no transforms - loss |
FEMNIST | RotatedMNIST |
---|---|
If you find this code useful, please cite our paper:
@article{gu2024_LCFL,
title = {Novel clustered federated learning based on local loss},
author = {Endong Gu and Yongxin Chen and Hao Wen and Xingju Cai and Deren Han},
journal = {arXiv preprint arXiv:2407.09360v1},
year = {2024},
month = {7},
doi = {10.48550/arXiv.2407.09360}
}