Take the next learning step
Choose an initial value and step size. Step through a quadratic objective or play the whole trajectory.
Teaching model · computed in your browser
Follow the gradient
Choose a starting point and learning rate, then inspect every update toward a quadratic minimum.
a is the location of the minimum; x is the current parameter; η is the learning rate. The derivative is x − a. For this unit-curvature quadratic, an initial error contracts precisely when 0 < η < 2. This condition does not automatically apply to a different loss function.
Try this: keep the same starting point and compare η = 0.5, 1, 2, and 2.5. Watch the distance from the minimum rather than the learning rate alone.
Playback starts only when you choose Play. It pauses when this tab is hidden or the lab leaves view. Reduced-motion preferences slow the updates; Step always gives you direct control. Runs stop after 40 updates or at the display limit.
The default worked example is shown below.
Convergent: each update moves toward the minimum without crossing it. Press Step to compute x₁ = x₀ − η(x₀ − a).
| Update | x | Gradient x − a | Loss ½(x − a)² |
|---|---|---|---|
| 0 | -2 | -5 | 12.5 |
Learn the ideas behind this lab.
Follow a worked example, practice on your own, and return to the original project sources.
Progress is kept in this browser. How learning works