Initialization energy is NaN or Inf with jitter


#1

Hi everyone, I have a model which blows up for certain initial points when using jitter + adapt diag. I went through all the previous discussions on this topic and made sure the model was specified properly and that all my data was suitably preprocessed. It doesn’t blow up like this if I initialize from the prior mean, and when running 3 chains with jitter, 1 of 3 blows up at the initial point. So it seems like the jitter is causing it to randomly land on a bad initial point. Any thoughts on this? I’m not able to post the code yet, sorry about that.


#2

You are right - it sometimes happen since the jitter might be too large if you have a RV on a small scale (currently it jitter uniformly around the test value).

In your case, try setting the init=adapt_diag and feed starting value by hand.


#3

FWIW - this just happened to me too, and it took me a couple hours of debugging to realize what was going on.
What do you think about, if the user has init='jitter+adapt_diag', amending the error message (‘Bad initial energy…’) so that it suggests the jitter as a possible cause?


#4

We are currently trying to make the jitter more reliable https://github.com/pymc-devs/pymc3/issues/2856#issuecomment-367648655
Hopefully, this would get fixed soon!