FederatedLearningPyTorch MLP
A two-hidden-layer perceptron for MNIST digits, the 2NN of the FederatedAveraging experiments.
Image classification · 5 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Image classification
- Parameters
- 159K
- Operations
- 5
- Framework
- PyTorch
- Recurrent
- No
- Published
- AISTATS (arXiv 2016)
- Cited by
- 5,078 (as of 9 October 2026)
- Authors
- H. Brendan McMahan, Eider Moore, Daniel Ramage and others
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m1006
- Graph hash
- e406415395f9d12ef113dbb3df92d0911436b828aec296f2407faee9ef929ad2
- Skeleton hash
- 3b830b68917e8b64651582683eae1bdaa713a35e5e6354e2a83315b128469bb5
- Architecture hash
- fb5a070a1cb025251a4b89e11ec677491deebd7c1830d3458c15027d155f71bc
- Diagram SHA-256
- 94b4b599eceb72f303945afcd6b17a3874fbc4e60dcce3e273c45c70cb4df870
- TorchLens version
- 2.35.3
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
How this diagram was made
menagerie.classics.federated_nets:build_mlp: build({}) What it is
This is the multilayer perceptron that the Federated Learning paper calls the MNIST 2NN. In the paper it has 2 hidden layers of 200 units each with ReLu activations, and the paper reports 199,210 total parameters. The paper uses it to study a training method: FederatedAveraging (FedAvg), which combines local stochastic gradient descent on each client with a server that performs model averaging.
Federated Learning, the paper's term, leaves the training data distributed on mobile devices and learns a shared model by aggregating locally computed updates. For the experiments MNIST was divided among 100 clients, either shuffled (IID) or sorted by digit label so that each client received 2 shards of 300 examples. With a target of 97% test-set accuracy on MNIST, the paper reports that more computation per client decreased the number of communication rounds by 46× for the 2NN on the IID partition.
The 2NN is also the network in the paper's parameter-averaging experiment: two models started from the same random initialization and trained on different subsets of the data average into a model with lower loss on the full MNIST training set than either one.
Key idea. The paper introduces FederatedAveraging, which combines local stochastic gradient descent on each client with a server that performs model averaging.
- FedAvg MLP
- MNIST 2NN
- 2NN
- FederatedAveraging
- federated averaging
- federated learning
- multilayer perceptron
- digit recognition
- fedavg-mlp
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{mcmahan2023communicationefficientlearningdeepnetworks,
title={Communication-Efficient Learning of Deep Networks from Decentralized Data},
author={H. Brendan McMahan and Eider Moore and Daniel Ramage and Seth Hampson and Blaise Agüera y Arcas},
year={2023},
eprint={1602.05629},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/1602.05629},
}