Skip to content

PengchaoHan/Adaptive_Gradient_Sparsification_FL

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Adaptive Gradient Sparsification for Efficient Federated Learning: an Online Learning Approach

This repository includes source code for the paper P. Han, S. Wang, K. K. Leung, "Adaptive gradient sparsification for efficient federated learning: an online learning approach," IEEE International Conference on Distributed Computing Systems (ICDCS), Nov. 2020.

Getting Started

The code runs on Python 3 with Tensorflow version 1 (>=1.13). To install the dependencies, run

pip3 install -r requirements.txt

Then, download the datasets manually and put them into the datasets folder.

run

cd ./data/femnist

./preprocess.sh -s niid --sf 0.05 -k 100 -t sample

  • For CIFAR-10 dataset, download the "CIFAR-10 binary version (suitable for C programs)" from https://www.cs.toronto.edu/~kriz/cifar.html, extract the standalone *.bin files and put them into datasets/cifar-10-batches-bin.

To test the code:

  • Set parameters in config.py
  • Run simulation.py

Code Structure

All configuration options are given in config.py which also explains the different setups that the code can run with.

The results are saved as CSV files in the results folder. The CSV files should be deleted before starting a new round of experiment. Otherwise, the new results will be appended to the existing file.

Currently, the supported datasets are FEMNIST and CIFAR-10, and the supported model is CNN. The code can be extended to support other datasets and models too.

Citation

When using this code for scientific publications, please kindly cite the above paper.

Third-Party Library

This code is derived from https://github.com/IBM/adaptive-federated-learning

About

Adaptive gradient sparsification for efficient federated learning: an online learning approach

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages