Bayesian Neural Networks at Finite Temperature

Robert J. N. Baldock, Nicola Marzari
4/8/2019
stat.MLcond-mat.dis-nncs.LG
bayesian

Official code: rjnbaldock/nn_sample (1 star, Python, MIT, last commit 2019-08-26).

Abstract

We recapitulate the Bayesian formulation of neural network based classifiers and show that, while sampling from the posterior does indeed lead to better generalisation than is obtained by standard optimisation of the cost function, even better performance can in general be achieved by sampling finite temperature ($T$) distributions derived from the posterior. Taking the example of two different deep (3 hidden layers) classifiers for MNIST data, we find quite different $T$ values to be appropriate in each case.

Show full abstract

In particular, for a typical neural network classifier a clear minimum of the test error is observed at $T>0$. This suggests an early stopping criterion for full batch simulated annealing: cool until the average validation error starts to increase, then revert to the parameters with the lowest validation error. As $T$ is increased classifiers transition from accurate classifiers to classifiers that have higher training error than assigning equal probability to each class. Efficient studies of these temperature-induced effects are enabled using a replica-exchange Hamiltonian Monte Carlo simulation technique. Finally, we show how thermodynamic integration can be used to perform model selection for deep neural networks. Similar to the Laplace approximation, this approach assumes that the posterior is dominated by a single mode. Crucially, however, no assumption is made about the shape of that mode and it is not required to precisely compute and invert the Hessian.

View on arXivView PDF

Code Implementations(1)

MIT
10PythonJan 11, 20197 years agoMIT

Similar Papers

Cite this paper

@article{baldock2019bayesian,
  title  = {Bayesian Neural Networks at Finite Temperature},
  author = {Robert J. N. Baldock and Nicola Marzari},
  year   = {2019},
  eprint = {1904.04154},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1904.04154}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1904.04154.svg)](https://codeofpaper.com/paper/1904.04154)

Discussion