Share
Share
Copy Link
In this article
Close
Loss measures how far a prediction misses its target. We'll use squared error.
Give the network 1. It predicts 1. The target is 2.
- Subtract the target from the prediction. The error is 1 − 2 = −1.
- Multiply the error by itself. The loss is (−1) × (−1) = 1.
| Prediction | Target | Error | Loss |
|---|---|---|---|
| 1 | 2 | −1 | 1 |
| 2 | 4 | −2 | 4 |
| 3 | 6 | −3 | 9 |
To get the mean squared error, average the three losses.
(1 + 4 + 9) ÷ 3 ≈ 4.67
Exercise
Keep the target at 2. Try a prediction of 1, then 3. Why do both guesses get the same loss?
QUOTE:
"Amateurs hack systems, professionals hack people."