-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Implement model transform to remove minibatching operations from graph #7521
Comments
] |
This is the correct behavior. Minibatch is defined as a stochastic slice of the random variable. You can define a model without minibatch and use the old trace to sample a full size dataset with posterior predictive |
I have edited the original post to describe the issue as an enhancement/feature request rather than a bug. I'm not able to modify labels on my end though. |
Thanks I did that. Note that my suggestion of a model transform wouldn't do anything automatically. The API would be something like: with pm.Model() as minibatch_m:
... # define model with minibatch
idata = pm.sample()
with remove_minibatch(minibatch_m) as m:
pm.sample_posterior_predictive(idata) |
Description
When using
pm.Minibatch
, thepm.sample_posterior_predictive
returns predictions with the size of the minibatch instead of the full dataset size. To make predictions on the full dataset requires the previous trace to be passed into a new model with a similar setup. For complicated models, this would add several lines of code to create a new model that is almost identical to the previous model.This enhancement would make it easier to perform posterior predictive checks when using minibatch.
relates to: https://discourse.pymc.io/t/minibatch-not-working/14061/10
Example scenario:
Before:
The text was updated successfully, but these errors were encountered: