Lesson 3 of 13 11 min · 112 words From lecture slides
KL divergence
How much information is lost when Q is used to approximate the true distribution P.
The Kullback–Leibler divergence compares a true or reference distribution P with an approximate or predicted distribution Q.
For continuous distributions:
Steps: check both are valid distributions (non-negative, sum to 1); compute ; take the log (base 2 or ); multiply by ; sum over .
Worked example with , : ratios and ; logs and ; weighted and ; so .
KL is not symmetric: in general, and it lies in . It shoots to infinity when the distributions do not overlap, which makes it unstable for training GANs.
Formula to remember
KL divergence (continuous)
Slides
Continuous form of KL.
Quick check · +5 XP