-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add acclogp_assume!!
and acclogp_observe!!
#565
Conversation
Pull Request Test Coverage Report for Build 6977964954
💛 - Coveralls |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #565 +/- ##
==========================================
+ Coverage 81.00% 81.03% +0.02%
==========================================
Files 26 26
Lines 3170 3174 +4
==========================================
+ Hits 2568 2572 +4
Misses 602 602 ☔ View full report in Codecov by Sentry. |
Related to #390? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @torfjelde -- while I am happy with these changes, I find the increasingly deeper tilde pipeline hard to read. We should improve the docs, or try to simplify that in the future.
Co-authored-by: Hong Ge <[email protected]>
This PR adds two new methods:
acclogp_assume!!
acclogp_observe!!
The idea is to provide slightly more control over the
acclogp!!
process, beyond (#563).The main motivation for this, is to fix the bug where particle samplers in Turing.jl currently do not respect the contextual tilde-pipeline since we accumulate the
logp
in the "leaf" of the tilde-pipeline, e.g.observe
andassume
:This means that any context which alters the value of
logp
, e.g.MiniBatchContext
, will have no effect.After this PR, particle samplers can overload
acclogp_observe!!
to runLibtask.produce(logpdf(dist, value))
, which occurs at the very end of the tilde-pipeline, hence allowing these samplers to also respect the context behaviors.