To sample ppc after minibatch inference is the following:
- Initialize model with shared data, not minibatch.
- Create minibatches for inference using
pm.Minibatch
Usemore_replacements
argument in fit likeapprox = pm.fit(more_replacements={full_x: minibatch_x, full_y:minibatch_y}, ...)
- After that you can get trace from approximation and pass it to
sample_ppc
.Note that it will perform ppc for examples you defined in step 1, not minibatches. There you are free to set any data you like.
- You can not sample a Deterministic node, but there might be workaround for that to do
draw_value
from a Deterministic. We have a student working on approximate Bayesian computation as a GSOC project will probably implement this in near future.