Published March 30, 2018 | Version v2
Software Open

A PyTorch Implementation of Federated Learning

Creators

  • 1. University of Queensland

Contributors

Other:

  • 1. HES-SO

Description

A PyTorch implementation of the federated averaging algorithm on MNIST and CIFAR10 (both IID and non-IID). 

Requirements

python>=3.6
pytorch>=0.4

Run

The MLP and CNN models are produced by:

python main_nn.py

Federated learning with MLP and CNN is produced by:

python main_fed.py

See the arguments in options.py.

For example:

python main_fed.py --dataset mnist --iid --num_channels 1 --model cnn --epochs 50 --gpu 0

--all_clients for averaging over all client models

NB: for CIFAR-10, num_channels must be 3.

 

Files

Files (8.3 kB)

Name Size Download all
md5:c18c9dcac3a42f3d3b013a64ff68ccfe
8.3 kB Download

Additional details

References

  • McMahan, Brendan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Agüera y Arcas. Communication-Efficient Learning of Deep Networks from Decentralized Data. In Artificial Intelligence and Statistics (AISTATS), 2017.