Why this one matters. Loss told you how wrong a line is. It never told you which way to move. That gap is what gradient descent fills. Standing at your current a and b, it asks a narrow question — would nudging this number up or down make the loss smaller? — and then takes one step in the answer's direction. Repeat, and the line walks itself into place. Nobody solves anything; it just keeps stepping downhill. Every model you will ever train learns this way.
Arrived from Loss and Metric? The L (loss) box below is the Mean Square Error you just met — the same squared misses, averaged. The two boxes marked ∂L/∂a and ∂L/∂b are the new part: each says which way its parameter should move, and how urgently. Multiply by alpha, subtract, and that is one step.
The table starts empty on purpose. Press Initialize to set a starting line, then Next to take one step at a time and watch the loss fall.
Stuck on a symbol? Any label followed by a small mark explains itself — try this one and the explanation opens underneath it. That covers all six table headings, both data boxes, a, b and alpha, and every derivative below the table.
Want the formulas? Open 📝 Notes at the top of this page. It goes further into the concept and gives the formula behind every value you will see here — the loss, each derivative, and the update rule that moves a and b on each step.
Everything here is yours to choose. Everything below the buttons is calculated from it.
You planted a starting line, ŷ = x + , taken straight from the dropdowns — the data had no say in it. The table now measures how wrong that guess is: the last column squares every miss, and their average is the loss, .
Not sure what a symbol means? Every column heading in the table, and every label beneath it, explains itself — click the small mark beside it and the explanation opens just below.
The calculation for the first step has already been made. a goes alpha () × to , and b goes × to — that is what the After this step row already shows.
Nothing has moved yet, though. The line becomes ŷ = x + the moment you press Next.
The line is now ŷ = x + — the Line now row above the table — and its loss is , down from .
The gradient boxes have already moved on to the next step: a goes alpha () × to , and b goes × to . Different distances, because each parameter has its own gradient. That is the After this step row, and it becomes the Line now row when you press Next.
Press Next again. The gradients shrink as the line closes in, so the steps shrink with them — nobody tells it to slow down. Switch the chart to Loss to watch the curve flatten.
It rose from to . The direction was right; the step was too long. With alpha at the jump sails clean past the bottom and lands further up the far side.
This is the whole job of the learning rate. Press Next again to watch it get worse, or pick a smaller alpha and press Initialize to start over.
| \(x\) | \(y\) | \(ŷ\) | \(ŷ-y\) | \(2(ŷ-y)\) | \((ŷ-y)^2\) |
|---|