katzfuss-group / batram

Bayesian Transport Maps for non-Gaussian Spatial Fields
MIT License
4 stars 2 forks source link

[bug] unstable log prob calculations #13

Closed danjdrennan closed 1 year ago

danjdrennan commented 1 year ago

There are side effects from using the conda versus pip based installations of pytorch. Tracing back differences between the two in simulations, an apparent effect is the use of covariance matrices or matrix inversions instead of Cholesky factors. The problem leads to torch mistakenly classifying some matrices as non-positive definite using an approximation to the Cholesky when the matrix is actually positive definite. This raises an error, halting the program where the error occurs.

The fix is to find all occurences where we do not use a Cholesky factorization or Cholesky solve and replace them with more numerically stable algorithms.

danjdrennan commented 1 year ago

This should be raised on the forked repo, not the main. Closing here and reopening in a fork.