Run A
SGD
- Current step
- 0
- Loss
- 16.5636
- Position
- (-3.400, 2.300)
- Gradient magnitude
- 13.8060
This lab compares how a few standard optimizers move across the same 2D loss surface. It is fully client-side and built for quick experimentation: change the surface, nudge the start point, and see the trajectories update immediately.
The math layer is implemented as deterministic pure functions, and the UI keeps playback, controls, and rendering separate so the feature stays easy to extend.
Click anywhere on the plot to move the shared start point.
Compare how each optimizer is moving right now.
SGD
ADAM
A narrow valley with very different curvature along each axis. This is a classic setup for seeing zig-zagging SGD paths and the stabilizing effect of adaptive methods.
SGD follows the raw gradient directly. It is easy to reason about, but it can zig-zag badly in narrow valleys and is sensitive to the learning rate.
Adam combines momentum with per-coordinate scaling. It usually settles quickly on these toy surfaces and makes adaptive behavior easy to compare.
Copyright © 2020 - 2026 Alex Leung