The learning loop
A model (the line) improves by repeating four steps. Step through one round at a time, or let it run.
- 1PredictUse the current line to guess y for every training x.
- 2Measure the lossAverage the squared misses into one number.
- 3Find the directionWork out which way to nudge w and b to lower the loss.
- 4UpdateMove w and b a small step that way. Repeat.
- Training points (used to learn)
- Test points (held back)
- Current line
The line starts out wrong. Press Next step to begin the first round.
Round0
Training loss0.1007
Test loss0.0858
Slope w-0.5
Intercept b0.85
Try this
- Step through one full round with Next step and read each note.
- Run with a small step size, then with the largest. Compare the loss curves.