PPolySim OS

Gradient Descent

The workhorse of machine learning, made visible. Watch a ball follow the gradient downhill across different loss landscapes.

Gradient Descent StudioLive

Controls

Watch gradient descent (with momentum) roll downhill on different loss landscapes. Too high a learning rate overshoots.

Presets

▶ Run in Python

Data Inspector

Surfaceripple
Step0/200
Optimizermomentum GD

Governing equation

Reading this result: A learning rate of 3 is well matched to the curvature here: steps are large enough to make progress yet small enough to avoid overshoot, giving a smooth, roughly quadratic descent toward the minimum.

Runs locally in your browser — free forever. Scale to the cloud when reality gets heavy.

or unlock everything with Pro →
★ Sign in to save this setup
Save your tuned setup, or drop this simulation into your own site, docs, or course page.

How it works

Gradient descent with momentum follows the negative gradient of a 2D loss surface toward a minimum. Try the Rosenbrock valley to see why optimization is hard, and push the learning rate too high to watch it overshoot and diverge — the same dynamics that govern training neural networks.

Ask the AI about this model

The math, the assumptions, real-world uses, or a code translation — explained for this exact simulation.

Related live simulations

Frequently asked questions

Is this gradient descent visualization tool really free?
Yes. Gradient Descent runs entirely in your browser using your device's own compute, so local use is free forever. You only pay Compute Tokens if you scale a job to the cloud.
Do I need to install anything?
No. Everything runs client-side in a modern browser — no downloads, no license, no account required to start.
Can I save or share my simulation?
Create a free account to save projects, and use a shareable embed or minted DOI to publish a live, interactive version anywhere.
How accurate are the results?
The solver uses established numerical methods, but results are for research and educational purposes and should be validated against experiment or professional review before you rely on them.