Thanks
Could you also give me a hint on how to predict on a hold out set?
I don’t understand how to implement what is described in https://docs.pymc.io/notebooks/api_quickstart.html for advi.
I do use minibatches but want to use the sample_posterior_predict on the holdout data.
input_var = pm.Minibatch(X_train, batch_size=32)
target_var = pm.Minibatch(y_train, batch_size=32)
neural_network = build_ann(GaussWeights())
with neural_network:
inference=pm.ADVI()
mean_field = pm.fit(n=500, method=inference, score=True)
trace = mean_field.sample(500)
input_var = theano.shared(X_test[:50, …].astype(np.float64))
target_var = theano.shared(y_test[:50, …].astype(np.float64))
with neural_network:
ppc = pm.sample_posterior_predictive(trace)
But ppc[‘out’] has the shape 500,32 (seems to be from the minibatches)