-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Check that sampler vars correspond to value variables in the model #6235
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
Check that sampler vars correspond to value variables in the model #6235
Conversation
c703867
to
8934bc8
Compare
2cb82ee
to
2f2a139
Compare
Why did the github bot remove the maintenance label? |
2f2a139
to
65e8454
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6235 +/- ##
==========================================
+ Coverage 88.15% 90.47% +2.32%
==========================================
Files 111 111
Lines 23820 23809 -11
==========================================
+ Hits 20998 21542 +544
+ Misses 2822 2267 -555
|
4c0c16c
to
5086972
Compare
5086972
to
0d30225
Compare
This recent Discourse topic touches on the same issue of trying to pass something that's not an RV to a function that expects RVs: https://discourse.pymc.io/t/trying-to-use-pm-binarymetropolis/10645 With the changes in the PR the new error message would be (condensed example): import pymc as pm
with pm.Model() as logistic_model_pred:
p = pm.Beta("p", 1, 1)
label = pm.Data("label", value=[0, 1, 2], mutable=True)
observed = pm.Bernoulli("occupancy", p, observed=label)
step = pm.BinaryMetropolis(vars=label)
|
6a8ae88
to
86686c2
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
86686c2
to
f17836c
Compare
Ready for review |
82af27e
to
7295de4
Compare
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.
LGTM. Minor nit but feel free to ignore.
7295de4
to
24e9545
Compare
…are valid Deprecates old `allinmodel`
Also improve docstrings
24e9545
to
059ef47
Compare
f548720
to
f66f320
Compare
The MacOS job got stuck in conda-cache. Gonna take a risk and merge regardless |
Closes #6223
I decided to not allow the old V3 behavior of passing intermediate variables/ Deterministic because I think that does something strange. Those variables are not the ones being sampled/maximized but instead the underlying input value variables are.
If a user wants to fit the variables that underlie a given graph, but he doesn't know what those are, they should do something like
pm.find_MAP(vars=pm.inputvars(pm.aesaraf.rvs_to_value_vars(graph)))
Update: It is now allowed but a warning is emitted
Major / Breaking Changes
Bugfixes / New features
Docs / Maintenance
find_MAP