-
Notifications
You must be signed in to change notification settings - Fork 219
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
Mechanism to reject samples #702
Comments
Just to clarify the relationship with #703: Even with safe mode 'off', the exception that would be thrown for sample rejection would not cause the sampling to fail; only to reject the sample. Anyway, perhaps the dev team will decide on a different implementation than an exception. |
During sampling, at least for HMC, we reject samples for which the energy is Why not exception? Simply because it is slow. But you can always catch error and return |
One can now do |
Might be worth to add this to the docs. |
Sure! |
Thanks for implementing this! |
What's the current way to do it? |
The current way is Turing.acclogp!(_varinfo, -Inf) which uses the internal variable @addlogprob!(-Inf) instead (see TuringLang/DynamicPPL.jl#143 and the issue linked therein). |
Closed by #1391. |
It would be useful to have a way for a probabilistic program to reject a sample. A possible implementation is that the program throws a specific exception to signal rejection.
The text was updated successfully, but these errors were encountered: