Chapter 2 of 12All chapters
Chapter 2 of 12
How machine learning works
Guess, measure the error, adjust.
The training loop
A model starts with random numbers, makes a prediction, compares it against the right answer, and nudges the numbers to reduce the error. Repeat that billions of times and the numbers encode a useful pattern.
- The measure of wrongness is the loss function, and training minimises it.
- Nobody writes the rule. It emerges in the numbers, which is why it cannot simply be read back.
Training and inference
Training is the expensive one-off process. Inference is running the finished model on a new input, which is cheap by comparison and is what happens when you use one.