probml / pml2-book

Probabilistic Machine Learning: Advanced Topics
MIT License
1.37k stars 118 forks source link

Error - Equation 10.50 #297

Closed josifgrabocka closed 1 month ago

josifgrabocka commented 8 months ago

The KL divergence between two gaussians "KL(N(mu, sigma), N(0,1)) = -log \sigma + 1/2 sigma^2 + 1/2 mu^2" instead of 1/2 (-log sigma^2 + sigma^2 + mu^2)

We can double-check that "1 = argmin_sigma -log \sigma + 1/2 sigma^2" and "0 = \argmin_mu mu^2", hence N(mu=0, sigma=1)=N(0,1) leading to KL=0.

Equation 5.78 is correct and since 10.50 follows 5.78, then 10.50 can be corrected.

murphyk commented 1 month ago

I think these are equivalent, since 0.5 log (sigma^2) = log (sigma)?

Screenshot 2024-06-26 at 1 40 29 PM
murphyk commented 1 month ago

oh, it's the +1 term that differs. Fixed.