Empirical objectives
An empirical objective is the average stated loss over all examples in a fixed dataset.
On this page 7 sections
01An empirical objective averages per-example losses over a fixed dataset#
An empirical objective averages per-example losses over a fixed dataset. Every example counts, including repeated values and zero losses.
Three examples give losses 1, 4 and 7. Sum all three, then divide by their count.
Losses: . Find their empirical average.
Show answer and explanation
Sum over examples: .
02If predictions and targets are supplied, compute each loss before averaging#
If predictions and targets are supplied, compute each loss before averaging. Squaring the mean residual can give a different result.
Follow the stated convention: squared loss and half-squared loss differ by a factor of two.
Targets: ; predictions: . Each loss is . Find the mean loss.
Show answer and explanation
Per-example losses: 4.5, 2. Their average is .
03The denominator is the number of examples, not the number of distinct loss values#
The denominator is the number of examples, not the number of distinct loss values. A zero-loss example still belongs in that count.
This average describes the observed dataset. It need not equal the unknown expected loss on new population draws.
Losses: . A draft divides the sum by 3 distinct losses. Correct the average.
Show answer and explanation
Sum over examples: .
Compute every loss with its stated convention, sum them and divide by the actual example count.
- Form an average per-example loss over a fixed dataset.
Sources & further reading
- [1]Dive into Deep Learning §12.5.2 ↗Dive into Deep Learning §12.5.2 · Article