Home▸Physics & Mechanics▸Gradient Descent versus Heavy-Ball Momentum on Contour Lines (2D)

Gradient Descent versus Heavy-Ball Momentum on Contour Lines (2D)

Contour lines of an elongated quadratic valley with the gradient-descent and heavy-ball paths drawn step by step, plus the live loss curve and the theoretical convergence rates. Same shared model as the 3D scene.

Physics & Mechanics2DAdvanced60 FPS📱 Mobile-adapted🟠 Blender⇄ 3D version
Gradient Descent versus Heavy-Ball Momentum on Contour Lines (2D) ↗ Open standalone

Two balls roll down the same elongated quadratic valley: one takes plain gradient-descent steps, the other adds heavy-ball momentum. Change the valley condition number, the step size and the momentum and watch zig-zagging, convergence, overshoot and divergence. Spectral-radius rates, the optimal step and the square-root speed-up of momentum are checked numerically.

⚙ Under the hood

Contour lines of an elongated quadratic valley with the gradient-descent and heavy-ball paths drawn step by step, plus the live loss curve and the theoretical convergence rates. Same shared model as the 3D scene.

Gradient DescentMomentumCondition NumberOptimizationConvergence Rate

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

What did you find?

Add reproduction steps (optional)