MoonSay /Tutorials/Machine Learning Interview #8
Contents
  1. 01Introduction
  2. 02Surprise
  3. 03Entropy
  4. 04Cross-entropy
  5. 05KL divergence
  6. 06Information gain and mutual information
  7. 07Why training minimizes cross-entropy
  8. 08Common misconceptions
  9. 09Interview questions and model answers
  10. 10Summary
  11. References

08Common misconceptions

  • “KL divergence is a distance.” It is not symmetric and does not satisfy the triangle inequality: 3.63 bits one way between the cities, 1.15 the other.
  • “Cross-entropy and KL are the same loss.” They have the same gradient and the same minimizer, but cross-entropy is larger by the entropy of the data. With one-hot labels that entropy is zero and they coincide.
  • “A good model reaches zero loss.” The floor is the entropy of the data. Miami’s weather costs 0.99 bits a day even to a perfect forecaster.
  • “Entropy is the surprise of the outcome.” Surprise belongs to one outcome; entropy is the average surprise of a whole distribution, known before the outcome is seen.
  • “Bits or nats change the answer.” The base only rescales every quantity by the same constant (1 nat =1.443 bits); minimizers, comparisons and perplexity are unchanged.
  • “Forward and reverse KL give the same fit.” Only when the model family contains p. Otherwise forward KL covers all modes and reverse KL picks one (Section 5.5).