Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jitter init should not give up if first try is nan #4107

Closed
twiecki opened this issue Sep 17, 2020 · 3 comments
Closed

jitter init should not give up if first try is nan #4107

twiecki opened this issue Sep 17, 2020 · 3 comments

Comments

@twiecki
Copy link
Member

twiecki commented Sep 17, 2020

Our default init is quite brittle when it comes to models that easily have nans or -infs for certain parts of the parameter space. STAN retries multiple times if the current value is no good and I think we should too. We could output to the user how many times we had to try and if it's high enough maybe tell them to try and make the model more robust.

@ricardoV94
Copy link
Member

I could work on this. Does anyone happen to have a simple "brittle" model that could be used as a testing case?

@twiecki
Copy link
Member Author

twiecki commented Dec 2, 2020

You could try with a model like htis:

with pm.Model():
    pm.HalfNormal('x', transform=None)

I haven't tried it so it might not work with this, but maybe can serve as a starting point.

@ricardoV94
Copy link
Member

Seems to work after a few tries. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants