Fit Temperature Scaling by Log Loss
Medium · Solved in PyTorch · Machine learning coding practice
Problem
A classifier can choose the right answer yet be too confident. Temperature scaling adjusts its probabilities by dividing raw scores (logits) by one positive value. Fit that value on held-out examples while keeping model weights frozen.
Choose the supplied temperature with the lowest mean negative log-likelihood: the average loss for the correct answers.
Topics: decision-models, calibration, cross-entropy
The full statement, worked examples, hints and the test suite are available once you sign in. You can then solve Fit Temperature Scaling by Log Loss in the browser and run it against the tests.