Not able to obtain Predicted values in Bayesian neural network

Have a look at: https://docs.pymc.io/notebooks/posterior_predictive.html

You can use:

preds = pm.sample_ppc(trace, model=model, samples=100) 
y_preds = preds['y']

to produce sample predictions on the data you used to train the model.

If you need to make predictions using other data as input, you can swap the data into ann_input since you use a shared Theano layer, and then run the sample_ppc

1 Like