// Interactive Playground

Gradient Descent Playground

Click anywhere on the loss surface to drop a starting point, then watch the optimizer find the minimum — one step at a time.

Loss Surface Click to start

Click on the surface to place a starting point, then hit Run

Controls Idle

Position
Loss
Step 0
Gradient Norm
Path log will appear here...

How It Works

1. Pick a Start

Click anywhere on the 2D loss surface. That's your initial guess — usually far from the minimum.

2. Compute Gradient

The gradient tells us which direction is "downhill." It's the vector of partial derivatives of the loss with respect to each parameter.

3. Take a Step

We move opposite the gradient by a factor of the learning rate. Too big and you overshoot; too small and you crawl.

4. Converge

SGD bounces around, Momentum smooths the path, and Adam adapts per-parameter. Each finds the valley differently.