ndeutschmann / zunis

Normalizing flows for neural importance sampling
https://zunis.readthedocs.io
MIT License
32 stars 6 forks source link

log determinant calculation numerically unstable #28

Closed kevjshih closed 2 years ago

kevjshih commented 3 years ago

This is a fantastic library with great documentation! I just wanted to throw in a suggestion that the log determinant calculations be fixed to use the sum of logs instead of the log of products. The current implementation does tend to result in infs when dealing with higher dimensional data.

https://github.com/ndeutschmann/zunis/blob/1a75e005c6ee4652f9f3abf64ce9d14d32e5b2c1/zunis_lib/zunis/models/flows/coupling_cells/piecewise_coupling/piecewise_linear.py#L75

ndeutschmann commented 3 years ago

That’s a good point, I’ll fix this in the coming days. Many thanks!

ndeutschmann commented 2 years ago

Fixed with #37. Thanks again for pointing it out!