HomeData ScienceNesterov Momentum: Contour Map & Convergence Race

Nesterov Momentum: Contour Map & Convergence Race

A 2D contour-map view of plain gradient descent, classical momentum, and Nesterov accelerated gradient racing down an elongated quadratic valley, paired with a live log-loss convergence chart. Tune condition number, learning rate, and momentum to see the look-ahead gradient damp oscillation in real time.

Data Science2DAdvanced60 FPS📱 Mobile-adapted⇄ 3D version
2d-ds-topic-32 ↗ Open standalone

This is the 2D counterpart to the rotatable 3D valley: instead of a rendered surface, the loss landscape f(x,y) = ½(κx² + y²) is drawn as its true analytic contour map — concentric ellipses computed directly from the level-set equation, with the gradient field sampled as arrows across the plane. Plain gradient descent, classical (heavy-ball) momentum, and Nesterov accelerated gradient all descend from the same corner using the exact recurrences that define them, and a second panel plots log₁₀(loss) against step count for all three in real time — the most direct way to see Nesterov's accelerated O(1/k²) convergence rate as a straight, steep line next to GD's slow crawl and momentum's characteristic overshoot ringing. Drag the condition-number, learning-rate, and momentum sliders to explore the stability boundary η < 2/κ and watch the two views update together.

⚙ Under the hood

A 2D contour-map view of plain gradient descent, classical momentum, and Nesterov accelerated gradient racing down an elongated quadratic valley, paired with a live log-loss convergence chart. Tune condition number, learning rate, and momentum to see the look-ahead gradient damp oscillation in real time.

gradient descentnesterov momentumoptimizationmachine learningloss landscapeconvergence

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)