An unofficial PyTorch implementation of a federated learning algorithm
Federated Averaging (FedAvg) in PyTorch
An unofficial implementation of FederatedAveraging (or FedAvg) algorithm proposed in the paper Communication-Efficient Learning of Deep Networks from Decentralized Data in PyTorch. (implemented in Python 3.9.2.)
Implementation points
- Exactly implement the models (‘2NN’ and ‘CNN’ mentioned in the paper) to have the same number of parameters written in the paper.
- 2NN:
TwoNN
class inmodels.py
; 199,210 parameters - CNN:
CNN
class inmodels.py
; 1,663,370 parameters
- 2NN:
- Exactly implement the non-IID data split.
- Each client has at least two digits in case of using
MNIST
dataset.
- Each client has at least two digits in case of using
- Implement multiprocessing of client update and client evaluation.
- Support TensorBoard for log tracking.
Requirements
Configurations
Run
Results
MNIST
- Number of clients: 100 (K = 100)
- Fraction of sampled clients: 0.1