University · Optimization
Take gradient descent steps
Choose a learning rate and see why convergence can be steady or oscillating.
Predict what will happen, press Play, then pause and explain what changed. Every control also works without playback.
Watch the relationship
PausedHD animation studio
From experiment to screen.
Present a crisp Canvas scene, save a full-HD image, or capture your model as a silent video.
Understand what you are seeing
The idea behind the motion.
Gradient descent moves against a function's derivative to reduce its value. For f(x) = x²/2, the update is especially transparent: x becomes (1 − η)x. The magnitude shrinks when 0 < η < 2. Rates above one alternate across the minimum while still converging for this particular quadratic.
A relationship to keep
xₙ₊₁ = xₙ − ηf′(xₙ) = (1 − η)xₙ
Read the symbols alongside the explanation. A diagram shows the relationship; the assumptions tell you when it applies.
- STEP 1
Find the slope
On this curve the derivative at x is exactly x. The update subtracts η times that derivative. The teal curve is the objective and the amber points are discrete algorithm iterates.
- STEP 2
Compare two kinds of convergence
With 0 < η < 1, the next point stays on the same side of zero. With 1 < η < 2, the factor 1 − η is negative, so successive points cross the minimum with decreasing distance.
- STEP 3
Check the function value
Playback shows twelve discrete updates. Each update multiplies f(x) by (1 − η)², which is less than one throughout the permitted range. At η = 1, one step reaches the minimum exactly.
Your turn to explain
Make a prediction. Test your reasoning.
Starting at x₀ = 4 with η = 1.5, what are x₁ and x₂? Does the loss decrease?
Use the values specified in the question. Reset restores the initial values for this investigation.
Compare your explanation
The update factor is −0.5, giving x₁ = −2 and x₂ = 1. The loss x²/2 decreases from 8 to 2 to 0.5 despite alternating sides.
Work through a full lesson
Connect the animation to a worked example and practice questions.