Evaluating minibatch trained model on test set

  1. see the comment by @ferrine in this issue. Copied below:

To sample ppc after minibatch inference is the following:

  • Initialize model with shared data, not minibatch.
  • Create minibatches for inference using pm.Minibatch
    Use more_replacements argument in fit like approx = 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.

  1. 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.