InferenceAI

Enter at least two characters to search.

Start free
INTERACTIVE LESSON LIBRARY

Gradient descent

Follow a parameter down a loss curve and see why step size matters.

INTERACTIVE ENGINEERING · TEACHING MODEL

Gradient descent

Follow a parameter down a loss curve and see why step size matters.

0L(w) = w²w
Parameter w3.0000
Loss w²9.0000

The dashed path connects successive updates. Follow the filled point.

Change the experiment

Core calculation
loss = w ** 2
gradient = 2 * w
w = w - learning_rate * gradient
Try it yourself

Compare learning rates 0.1, 0.5 and 1.1. Which converges fastest, and which diverges?

Update 0: w = 3.0000, loss = 9.0000.

For this quadratic, convergence requires 0 < learning rate < 1. Real training losses have different curvature.

Playback pauses in hidden tabs and offscreen. With reduced motion enabled, use the timeline or Next step.

Turn the idea into an implementation

Compare learning rates 0.1, 0.5 and 1.1. Which converges fastest, and which diverges?

Predict a result, change one input, then explain what happened. Use the timeline to revisit a state and compare it with the algorithm sketch.

Explain it in an interview

For this quadratic, convergence requires 0 < learning rate < 1. Real training losses have different curvature.

Describe the inputs, the state that changes, the computational cost and a limitation of the model before discussing a production implementation.