Home▸AI & Machine Learning▸Gradient Descent on a Loss Surface: Contour Map and Curvature Slices (2D)

Gradient Descent on a Loss Surface: Contour Map and Curvature Slices (2D)

The same race on a contour map: heat-coloured loss with equal-loss contours and the gradient field, trails of the three optimisers, a curvature ellipse at the red ball and two slices of the loss along the stiff and flat Hessian axes showing exactly what one gradient-descent step does on each. Same model and numerical checks as the 3D version.

AI & Machine Learning2DModerate60 FPS📱 Mobile-adapted🟠 Blender⇄ 3D version
Gradient Descent on a Loss Surface: Contour Map and Curvature Slices (2D) ↗ Open standalone

Read a loss function as a landscape and race three optimisers across it. Five analytic surfaces (a rotated elliptic bowl, the Rosenbrock banana valley, Himmelblau with four minima, a double well with a saddle, a rippled bowl) are built as a terrain with equal-loss contour lines, and plain gradient descent, heavy-ball momentum and Adam roll from the same start. The Hessian is read live: the stability limit eta < 2 / lambda_max, the local contraction factor max|1 - eta lambda| and the measured gradient contraction per step are shown side by side, with arrows for the descent direction and the stiff and flat curvature axes. Change the learning rate as a fraction of the stability limit, the condition number, the momentum, Adam's step size, gradient noise and the start point. Blender-built marbles, flags, arrows, plinth and boulders; numerical checks against the closed-form quadratic iteration, the 2/lambda stability boundary, the optimal heavy-ball and gradient-descent rates, finite-difference gradients, the Himmelblau minima and Adam's first step.

⚙ Under the hood

The same race on a contour map: heat-coloured loss with equal-loss contours and the gradient field, trails of the three optimisers, a curvature ellipse at the red ball and two slices of the loss along the stiff and flat Hessian axes showing exactly what one gradient-descent step does on each. Same model and numerical checks as the 3D version.

Gradient DescentLoss SurfaceLearning RateMomentumAdamHessianCondition NumberOptimization

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

What did you find?

Add reproduction steps (optional)