EasyDeepLearn

How does temperature scaling calibrate a classifier's probabilities?

medium

Answer

  • You take the trained logits z, divide by a scalar T > 0, then softmax: p = softmax(z / T).
  • T is fit on a held-out validation set by minimizing NLL.
  • T > 1 sharpens toward uniform (softens overconfident predictions — the typical case for deep nets); T < 1 sharpens toward one-hot.
  • It changes only confidence, not the argmax, so accuracy is unchanged but calibration (ECE, Brier) improves.
  • Cheap, single-parameter, widely used for post-hoc calibration.
Check yourself — multiple choice
  • It scales the input features by T
  • Divide logits by T and softmax; T is fit on validation to improve calibration
  • It replaces the loss function during training
  • It changes the model's predicted class

Divide logits by T; T fit on val. Doesn't change argmax — only confidence.

#calibration#classification

Practise Supervised Learning

215 interview questions in this topic.

Related questions