Joshuaalbert / jaxns

Probabilistic Programming and Nested sampling in JAX
https://jaxns.readthedocs.io/
Other
141 stars 9 forks source link

[Known Issue] non-terminating when likelihood is unstable in 32-bit #75

Closed Joshuaalbert closed 9 months ago

Joshuaalbert commented 1 year ago

Describe the bug Some likelihoods require higher precision to evaluate in some parameter regions. Sometimes when 32-bit precision is chosen (the default) nested sampling will not terminate. An example is the "Gaussian Shells" example. This potentially comes from instabilities violating assumptions of (non-strict) monotonicity of the likelihood during shrinkage.

Expected Behaviour Detect when 32-bit instabilities violate constraint assumptions, and terminate the nested sampler with informative termination status.

Actual Behaviour Nested sampling does not terminate.

Temporary Solution Put the following at the very top of your script,

from jax.config import config
config.update("jax_enable_x64", True)

JAXNS version Affects JAXNS 2.0

Joshuaalbert commented 9 months ago

Fixed