-
Notifications
You must be signed in to change notification settings - Fork 25
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 fix
and unfix
#488
Add fix
and unfix
#488
Conversation
get_conditioned_value and has_conditioned_value
Pull Request Test Coverage Report for Build 5298956606
💛 - Coveralls |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #488 +/- ##
==========================================
+ Coverage 76.40% 76.45% +0.04%
==========================================
Files 21 21
Lines 2522 2612 +90
==========================================
+ Hits 1927 1997 +70
- Misses 595 615 +20
☔ View full report in Codecov by Sentry. |
I don't think there's anything holding this PR back? We've agreed that |
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.
A few smaller comments regarding the docstrings 🙂
I'm a bit worried that GH points out quite a few new lines in the PR that are not covered by tests?
IMO a good follow-up PR would be to unify and simplify all these tree-based property extractions. In particular, the _nested
functions seem very similar logic-wise, so I wonder if their implementation could be unified by some more generic internal tree walk
?
Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
We currently have
condition
anddecondition
which does what you'd expect.But sometimes you want to
fix
variables without also making them be considered as an observation (whichcondition
does imply). Use-cases are plenty, but for example:fix
can also be considered ado
since it effectively cuts off the incoming edges to the variable wefix
.Turing.predict
it would be nice to just determine which variables are considered observations and which aren't, and then simply sample the observations rather than requiring the user to manually construct the model without the observations conditioned. The reason why we can't currently do that now is because it's very much within the realms of possibility that a user might domodel | (some_parameter=10, )
, run inference on this model, and then runpredict
. In such a scenario you'd end up also samplingsome_parameter
, which is unlikely to be the user's intention. If the user instead didfix(model, some_parameter=10)
, then we could correctly determine the observations. Related: predict() from a Prior-sampled chain returns no predictions Turing.jl#2012 (comment)I don't think this PR is too controversial with the exception of introducing an additional branch in the generated tilde-statements 😕 IMO this case is worth it + it's a very simple branch.