acerbilab / pyvbmc

PyVBMC: Variational Bayesian Monte Carlo algorithm for posterior and model inference in Python
https://acerbilab.github.io/pyvbmc/
BSD 3-Clause "New" or "Revised" License
114 stars 6 forks source link

fix: eliminate log warning by setting KL divergences to inf. #125

Closed pipme closed 1 year ago

pipme commented 1 year ago

When computing KL divergences between two multivariate Gaussians, there are warnings if one of them has zero determinant. The warning(actually it's also a minor bug since one of the KL divergences would be evaluated as -inf and later truncated to 0) is eliminated by directly returning KL divergences as np.inf in that special case.