Functions for Learning Bayesian Inference