Exercises
These exercises check the loss-function ideas from the chapter.
A model predicts 6, and the target is 10. Compute prediction - target.
Compute it first, then check your number.
A prediction is 2, and the target is 5. What is the squared error?
Compute it first, then check your number.
Squared errors are [4, 4, 1]. What is their mean?
Compute it first, then check your number.
Probabilities are [0.1, 0.2, 0.7]. The true class is class 3. What is p_true?
Compute it first, then check your number.
Shift logits [4, 1, -2] by subtracting the maximum. What is the second shifted value?
Compute it first, then check your number.
A model chooses one of 8 classes. Enter 1 for multiclass cross-entropy as the usual first choice, or 0 for mean squared error.
Compute it first, then check your number.