-
-
Notifications
You must be signed in to change notification settings - Fork 126
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
Internal refactor #804
Internal refactor #804
Conversation
This is temporarily suspended because the |
Now there's a new blocker which is pymc-devs/pymc#7312 And I would also like to have pymc-devs/pymc#7290 merged. Currently, the progressbar has many updates which slows down the sampler in jupyter notebooks. |
Everything should be fixed now. The Now I'm going to re-run examples. |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
I like the changes, but I find |
…mbi into rename_likelihood_params
Thanks for the review! I'm not sure I understand what is the suggestion (i.e. if you want argument(s) called |
I am saying that the name "params" is very vague. |
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.
I have been holding this PR back for too long. I reviewed the changes, but paid closer attention to the changes in interpret
and with bayeux
.
I really like the changes, and everything LGTM.
@GStechschulte thanks for the review! Do you have any ideas for the issue @aloctavodia mentioned? I agree the current approach is a bit vague. But I don't have lots of ideas right now :D |
@tomicapretto @aloctavodia apologies for the delayed response. This notification slipped through my GitHub 😞 Before, To be consistent in
|
… response distribution
This started as a refactor with the goal to change how we name the parameters of the response distribution. So far, we named the parent parameter with
f"{response_name}_mean"
and all the other parameters withf"{response_name}_{param_name}"
. I no longer think appending_mean
is a sensible approach as the parent parameter can be something different than the mean. And also, I realized prepending the name of the response resulted in very long and confusing names. For that reason, I decided it's better to just use the name of the parameter (i.e.mu
for the mean in many families,p
for probability of success,kappa
,sigma
, and so on).But that is not the only change. Many other changes come with this PR. I summarize them below, and they will be added to the changelog. After this is merged, we can have a 0.14.0 release.
Summary of changes
"__obs__"
instead off"{response_name}_obs"
as the dimension name for the observation index. This makes it easier to avoid errors in our code base and results in a clear an unique name for all cases. Previously we had to worry about the possible different names of the response and their aliases.param_name
instead off"{response_name}_{param_name"
(mentioned above).f"{response_name}_{mean}"
(mentioned above).kind
inModel.predict()
now use"params"
and"response"
instead of"mean"
and"pps"
.include_mean
has been replaced byinclude_params
inModel.fit()
. The old version still works, with a future warning.pm.Deterministic
. The benefit is that the model graphs are clearer and we don't incur in any penalty related to the computation and storage of deterministics as they are not computed and stored when sampling. This is thanks to some recent developments in PyMC.bayeux-ml
as the single direct JAX-related dependency. Bayeux itself requires all the other libraries providing sampling backends for us so we don't list them directly. This may change in the future if we need to pin specific versions but I hope that's not the case.create_posterior_bayeux
that creates thexarray.Dataset
that holds the samples from the posterior when doing inference via bayeux. This makes sure we use the right dim/coord names and coord levels.model.components["mu"]
. Before we neededmodel.response_component
. Now, that component still exists but it doesn't hold information about mu.Other important notes
EDIT Bayeux based inferences don't include theDoneobserved_data
group. This is problematic if we want to do ppchecks. We need to add them.EDIT: It also closes #814