Table of Contents
Fetching ...

Bayesian neural networks via MCMC: a Python-based tutorial

Rohitash Chandra, Joshua Simmons

TL;DR

This tutorial presents a tutorial for MCMC methods that covers simple Bayesian linear and logistic models, and Bayesian neural networks, and highlights the challenges in sampling multi-modal posterior distributions for the case of Bayesian neural networks and the need for further improvement of convergence diagnosis methods.

Abstract

Bayesian inference provides a methodology for parameter estimation and uncertainty quantification in machine learning and deep learning methods. Variational inference and Markov Chain Monte-Carlo (MCMC) sampling methods are used to implement Bayesian inference. In the past three decades, MCMC sampling methods have faced some challenges in being adapted to larger models (such as in deep learning) and big data problems. Advanced proposal distributions that incorporate gradients, such as a Langevin proposal distribution, provide a means to address some of the limitations of MCMC sampling for Bayesian neural networks. Furthermore, MCMC methods have typically been constrained to statisticians and currently not well-known among deep learning researchers. We present a tutorial for MCMC methods that covers simple Bayesian linear and logistic models, and Bayesian neural networks. The aim of this tutorial is to bridge the gap between theory and implementation via coding, given a general sparsity of libraries and tutorials to this end. This tutorial provides code in Python with data and instructions that enable their use and extension. We provide results for some benchmark problems showing the strengths and weaknesses of implementing the respective Bayesian models via MCMC. We highlight the challenges in sampling multi-modal posterior distributions for the case of Bayesian neural networks and the need for further improvement of convergence diagnosis methods.

Bayesian neural networks via MCMC: a Python-based tutorial

TL;DR

This tutorial presents a tutorial for MCMC methods that covers simple Bayesian linear and logistic models, and Bayesian neural networks, and highlights the challenges in sampling multi-modal posterior distributions for the case of Bayesian neural networks and the need for further improvement of convergence diagnosis methods.

Abstract

Bayesian inference provides a methodology for parameter estimation and uncertainty quantification in machine learning and deep learning methods. Variational inference and Markov Chain Monte-Carlo (MCMC) sampling methods are used to implement Bayesian inference. In the past three decades, MCMC sampling methods have faced some challenges in being adapted to larger models (such as in deep learning) and big data problems. Advanced proposal distributions that incorporate gradients, such as a Langevin proposal distribution, provide a means to address some of the limitations of MCMC sampling for Bayesian neural networks. Furthermore, MCMC methods have typically been constrained to statisticians and currently not well-known among deep learning researchers. We present a tutorial for MCMC methods that covers simple Bayesian linear and logistic models, and Bayesian neural networks. The aim of this tutorial is to bridge the gap between theory and implementation via coding, given a general sparsity of libraries and tutorials to this end. This tutorial provides code in Python with data and instructions that enable their use and extension. We provide results for some benchmark problems showing the strengths and weaknesses of implementing the respective Bayesian models via MCMC. We highlight the challenges in sampling multi-modal posterior distributions for the case of Bayesian neural networks and the need for further improvement of convergence diagnosis methods.
Paper Structure (28 sections, 46 equations, 12 figures, 2 tables, 2 algorithms)

This paper contains 28 sections, 46 equations, 12 figures, 2 tables, 2 algorithms.

Figures (12)

  • Figure 1: We show the relationship of the likelihood with data and prior distribution for sampling the posterior distribution.
  • Figure 2: Normal distributions with different parameters, i.e., mean and the standard deviation.
  • Figure 3: Gamma distributions with different shape and rate parameters ($\alpha$ and $\beta$).
  • Figure 4: Inverse gamma distributions with different shape and rate parameters ($\alpha$ and $\beta$).
  • Figure 5: Posterior and trace plot for the basic MCMC sampler given in Listing \ref{['lst:simple-mcmc']}.
  • ...and 7 more figures