【Learning record】Definition of KL divergence

KL divergence (KL divergence, Kullback-Leibler divergence) Definition: A measure describing the similarity of two probability distributions Q(x) and P(x), denoted as D(Q||P) .

(1) For discrete random variables, the KL divergence is defined asD(Q||P)=\sum_{i}^{}Q(i)log\frac{Q(i)}{P(i)}

(2) For continuous random variables, the KL divergence is defined asD(Q||P)=\int Q(x)log\frac{Q(x)}{P(x)}dx

 It is easy to prove that the KL divergence has the property: D(Q||P)\geq 0. If and only if Q=P, D(Q||P)=0.

In fact, using Jense's inequality:

-D(Q||P)=\int Q(x)log\frac{P(X)}{Q(X)}dx \leq log \int Q(x)\frac{P(X)}{Q(X)}dx = log \int P(x)dx=0

KL divergence is asymmetric and also satisfies the triangle inequality, not a distance measure in the strict sense 

Guess you like

Origin blog.csdn.net/Jessicaxu123/article/details/130244173