Contour map, gradient field and optimiser trails
Loss slices along the Hessian axes

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

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.

Made with 🟠 Blender