← 🧠 Machine Learning

📦 Batch Size Lab

Loss:
Best loss:
Gradient noise σ:
Steps taken: 0
FPS:
Drag — rotate · Scroll — zoom

📦 Batch Size Hyperparameters

A ball representing a model's parameters descends a 3D loss landscape, sampling mini-batches from a training data plane below — watch how batch size trades off gradient noise, convergence speed, and the ability to escape local minima.

🔬 What It Demonstrates

Gradient noise scales as roughly 1/√(batch size). Small batches jitter but can hop out of shallow local minima; large batches converge smoothly but may settle into the nearest basin.

🎮 How to Use

Adjust batch size and learning rate, then watch the highlighted mini-batch dots on the data plane and the ball's path on the loss surface update live. Reset to try a different starting point.

💡 Did You Know?

Research on "sharp vs. flat minima" suggests large-batch training tends to converge to sharper minima that generalize slightly worse, while small-batch noise acts as an implicit regularizer.