How roxanneluo/federated-learning works
This repository is a prototype for federated MNIST training. A client connects to the Flask-SocketIO server, receives model configuration, prepares a local non-IID dataset, trains on server-requested rounds, and returns weights and metrics; the server aggregates updates and can request final evaluation. The dashboard and stats endpoint expose training progress. Elastic averaging and multi-client launching are present as experimental extensions; the README’s multi-server gossip and client-only peer-to-peer approaches are stated as exploration goals, not implemented workflows. Evidence is limited to the excerpts and README.
Main entry points: fl_server.py Socket server · fl_client.py Federated client · ea_client.py Elastic client · dashboard.html Dashboard
Components 14
Server coordination
- Socket server
fl_server.py - Global model
fl_server.py - Weight aggregation
fl_server.py - Training metrics
fl_server.py - Dashboard
templates/dashboard.html
Client training
- Federated client
fl_client.py - Local model
fl_client.py
Data and models
- MNIST partitions
datasource.py - MNIST CNN
fl_server.py
Experiments
- Multi-client launcher
multi_client.py - Elastic client
ea_client.py - Elastic sync hooks
ea_client.py - Weighted server helper
server.py
Other components
- Operator
Connections 17
- Operator → Socket server: opens service
fl_server.py - Operator → Dashboard: views progress
- Socket server → Global model: initializes
fl_server.py - Global model → MNIST CNN: builds
fl_server.py - Socket server → Federated client: sends configuration
fl_server.py - Federated client → Socket server: sends updates
fl_client.py - Federated client → MNIST partitions: requests partitions
fl_client.py - Federated client → Local model: creates and trains
fl_client.py - Socket server → Weight aggregation: aggregates received updates
fl_server.py - Weight aggregation → Global model: updates weights
fl_server.py - Socket server → Training metrics: records metrics
fl_server.py - Socket server → Dashboard: serves view
fl_server.py - Multi-client launcher → Federated client: starts processes
multi_client.py - Elastic client → Federated client: extends client
ea_client.py - Elastic client → Elastic sync hooks: uses sync hooks
ea_client.py - Weighted server helper → Weight aggregation: alternative averaging
- Socket server → Training metrics: serves stats
fl_server.py