slimgroup / InvertibleNetworks.jl

A Julia framework for invertible neural networks
MIT License
149 stars 21 forks source link

rename `log_likelihood` and Co.? #50

Closed scheidan closed 2 years ago

scheidan commented 2 years ago

I've just discoverer this package and it look very interesting! Thanks a lot for putting this together.

Just a small point I stumbled on: The function log_likelihood implicitly means the log pdf of a multivariate Gaussian distribution (up to a constant). As statistician I can imagine many non-Gaussian likelihood functions so I find this naming that rather confusing. The docstrings of ∇log_likelihood and Hlog_likelihood do not contain a reference to the Gaussian distribution at all. Using log_likelihood_normal or so would clarify thinks a lot.

alisiahkoohi commented 2 years ago

Thank you for your interest and comment.

Our goal here was to provide a utility function intended for training normalizing flows, which involves computing the log-likelihood of the predicted latent variables. In normalizing flows, we typically assume that latent variables are normally distributed. Using JuliaStats' Distributions.jl implementation, you can incorporate the log-likelihoods of other distributions.

By looking at the code, the docstring reads,

Log-likelihood of X for a Gaussian distribution with given mean μ and variance σ. All elements of X are assumed to be iid.

We will make this also explicit in ∇log_likelihood and Hlog_likelihoods docstrings.