Step 3: First Experiment¶
Deploy federated learning with notebook workflow in 5 minutes
Run a complete MNIST federated learning experiment using the interactive notebook approach.
Open the Interactive Notebook¶
Navigate to the MNIST example and open the interactive notebook:
# Go to the example directory
cd examples/fl_pytorch_mnist
# Start Jupyter notebook
jupyter notebook swarm.ipynb
The notebook opens in your browser with a complete federated learning workflow.
Execute the Notebook Workflow¶
The notebook guides you through:
Step 1: Data Preparation - Run the data partitioning cell - MNIST dataset automatically split across nodes
Step 2: Swarm Deployment - Execute the swarm deployment cell - Uses your configured credentials automatically
Step 3: Training Monitoring - Real-time progress shown in notebook cells - Training metrics and graphs update automatically
Step 4: Results Visualization - Final accuracy and loss curves displayed - Model performance across all nodes shown
Expected Output in Notebook:
🚀 Starting federated learning experiment...
📊 Data prepared: 2 node partitions
🔄 Round 1/5: Average accuracy = 0.75
🔄 Round 2/5: Average accuracy = 0.85
🔄 Round 3/5: Average accuracy = 0.91
🔄 Round 4/5: Average accuracy = 0.93
🔄 Round 5/5: Average accuracy = 0.94
✅ Training completed! Final accuracy: 94%
Stop Nodes When Finished¶
After your experiment completes, clean up the running nodes:
# Stop all running nodes
manta_node stop --all
Expected Output:
🛑 Stopping all running nodes...
✅ Node 0: Stopped
✅ Node 1: Stopped
🎉 All nodes stopped successfully
Congratulations!¶
🎉 You’ve successfully completed your first Manta experiment!
In just 10 minutes, you’ve:
✅ Created platform account and got credentials ✅ Configured cluster with connected nodes ✅ Deployed federated learning experiment using notebook workflow ✅ Trained distributed model across multiple nodes ✅ Achieved 94% accuracy through federated averaging
What’s Next?
Now you’re ready to:
Build Custom Algorithms: See Tutorials for advanced patterns
Scale to Production: Explore Manta SDK Usage Guide for deployment options