The premise of approximate MCMC in Bayesian deep learning

\fnmsTheodore \snmPapamarkou\correflabel=e1] t.papamarkou@manchester.ac.uk [ Department of Mathematics, The University of Manchester, Manchester, UK
Abstract

This paper identifies several characteristics of approximate MCMC in Bayesian deep learning. It proposes an approximate sampling algorithm for neural networks. By analogy to sampling data batches from big datasets, it is proposed to sample parameter subgroups from neural network parameter spaces of high dimensions. While the advantages of minibatch MCMC have been discussed in the literature, blocked Gibbs sampling has received less research attention in Bayesian deep learning.

\kwd
\startlocaldefs\endlocaldefs\runtitle

The premise of approximate MCMC in Bayesian deep learning

Approximate MCMC \kwdBayesian inference \kwdBayesian neural networks \kwdblocked Gibbs sampling \kwdminibatch sampling \kwdposterior predictive distribution

1 Motivation

This paper pushes the frontiers of approximate MCMC in Bayesian deep learning. It is a research-oriented sequel of the review of exact MCMC for neural networks by Papamarkou et al. (2022).

Why develop approximate MCMC sampling algorithms for deep learning? The answer stems from a general merit of MCMC, namely uncertainty quantification. This work demonstrates how approximate MCMC sampling of neural network parameters quantifies predictive uncertainty in classification problems.

Several impediments have inhibited the adoption of MCMC in deep learning; to name three notorious problems, low acceptance rate, high computational cost and lack of convergence typically occur. See Papamarkou et al. (2022) for a relevant review.

Empirical evidence herein suggests a less dismissive view of approximate MCMC in deep learning. Firstly, a sampling mechanism that takes into account the neural network structure and that partitions the parameter space into small parameter blocks retains high acceptance rate. Secondly, minibatch MCMC sampling of neural network parameters mitigates the computational bottleneck induced by big data. Bayesian marginalization, which is used for making predictions and for assessing predictive performance, is also computationally expensive. However, Bayesian marginalization is embarrassingly parallelizable across test points and along Markov chain length. Thirdly, MCMC convergence does not seem necessary in order to make predictions and to assess predictive uncertainty via neural networks. A non-convergent Markov chain acquires valuable predictive information.

The paper is structured as follows. Section 2 briefly reviews the approximate MCMC literature for deep learning. Section 3 revises some basic knowledge, including the Bayesian multilayer perceptron (MLP) model and blocked Gibbs sampling. Section 4 introduces a finer node-blocked Gibbs (FNBG) algorithm to sample MLP parameters. Section 5 utilizes FNBG sampling to fit MLPs to three training datasets, making predictions on three associated test datasets. In Section 5, numerous observations are made about the scope of approximate MCMC in deep learning. Section 6 concludes the paper with a discussion about future research directions.

2 Literature review

Two research directions have been mainly taken to develop MCMC algorithms for neural networks. Initially, sequential Monte Carlo and reversible jump MCMC have been applied on MLPs and radial basis function networks (Andrieu, de Freitas and Doucet, 1999; de Freitas, 1999; Andrieu, de Freitas and Doucet, 2000; de Freitas et al., 2001). More recently, stochastic-gradient MCMC (SG-MCMC) algorithms have become a mainstream approach.

SG-MCMC belongs to the broader family of minibatch MCMC algorithms. In minibatch MCMC, a target density is evaluated on a subset (minibatch) of the data, thus avoiding the computational cost of MCMC iterations based on the entire data. Welling and Teh (2011) has employed the notion of minibatch to develop a stochastic gradient Langevin dynamics (SG-LD) Monte Carlo algorithm, which is the first instance of SG-MCMC. Chen, Fox and Guestrin (2014) have introduced stochastic gradient Hamiltonian Monte Carlo (SG-HMC) and applied it to infer the parameters of a Bayesian neural network fitted to the MNIST dataset (Lecun et al., 1998).

SG-LD and SG-HMC are two SG-MCMC algorithms that initiated approximate MCMC research in machine learning. Several variants of SG-MCMC have appeared ever since. Gong, Li and Hernández-Lobato (2019) have proposed an SG-MCMC scheme that generalizes Hamiltonian dynamics with state-dependent drift and diffusion, and have demonstrated the performance of this scheme on convolutional and on recurrent neural networks. Zhang et al. (2020) have proposed cyclical SG-MCMC, a tempered version of SG-LD with a cyclical stepsize schedule. Moreover, Zhang et al. (2020) have showcased the performance of cyclical SG-MCMC on a ResNet-18 (He et al., 2016) fitted to the CIFAR-10 and CIFAR-100 datasets (Krizhevsky and Hinton, 2009). Alexos, Boyd and Mandt (2022) have introduced structured SG-MCMC, a combination of SG-MCMC and structured variational inference (Saul and Jordan, 1995). Structured SG-MCMC employs SG-LD or SG-HMC to sample from a factorized variational parameter posterior density. Alexos, Boyd and Mandt (2022) have tested the performance of structured SG-MCMC on ResNet-20 (He et al., 2016) architectures fitted to the CIFAR-10, SVHN (Netzer et al., 2011) and fashion MNIST (Xiao, Rasul and Vollgraf, 2017) datasets.

Aside from research papers on MCMC for neural networks, there also exist reviews of the topic. For instance, see  Wenzel et al. (2020),  Izmailov et al. (2021) and  Papamarkou et al. (2022). Such reviews provide insights into the utility, challenges and future of MCMC in deep learning.

3 Preliminaries

This section revises two topics, the Bayesian MLP model for supervised classification (Subsection 3.1) and blocked Gibbs sampling (Subsection 3.2). For the Bayesian MLP model, the parameter posterior density and posterior predictive probability mass function (pmf) are stated. Blocked Gibbs sampling provides a starting point in developing the algorithm of Section 4 for sampling from the MLP parameter posterior density.

3.1 The Bayesian MLP model

An MLP is a feedforward neural network comprising an input layer, one or more hidden layers and an output layer  (Rosenblatt, 1958; Minsky and Papert, 1988; Hastie, Tibshirani and Friedman, 2016). For a fixed natural number , an index indicates the layer. In particular, refers to the input layer, to one of the hidden layers, and to the output layer. Let be the number of nodes in layer , and let be the sequence of node counts per layer. denotes an MLP with hidden layers and nodes at layer .

An with hidden layers and nodes at layer is defined recursively as

(3.1)
(3.2)

for . An input data point is passed to the input layer , yielding vector in the first hidden layer. The parameters at layer consist of weights and biases . The weight matrix has rows and columns, while the vector of biases has length . All weights and biases up to layer are denoted by . An activation function is applied elementwise to pre-activation vector , and returns post-activation vector . Concatenating all , gives a parameter vector of length .

denotes the -th element of weight matrix . Analogously, and correspond to the -th coordinate of bias , of input , of pre-activation and of post-activation .

MLPs are typically visualized as graphs. For instance, Figure 1 displays a graph representation of , which has an input layer with nodes (purple), two hidden layers with nodes each (blue), and an output layer with nodes (gray). Purple nodes indicate observed variables (input data), whereas blue and gray nodes indicate latent variables (post-activations).

Figure 1: A graph visualization of . Purple, blue and gray nodes correspond to input data, to hidden layer post-activations and to output layer (softmax) post-activations used for making predictions.

Let be a training dataset. Each training data point includes an input and a discrete output (label) . Moreover, let be a test point consisting of an input and of a label . The supervised classification problem under consideration is to predict test label given test input and training dataset . An , whose output layer has nodes and applies the softmax activation function , is used to address this problem. The softmax activation function at the output layer expresses as .

It is assumed that the training labels are outcomes of independent draws from a categorical pmf with event probabilities given by , where is the set of parameters. It follows that the likelihood function for the model in supervised classification is

(3.3)

where are the training inputs and denotes the indicator function. Interest is in sampling from the parameter posterior density

(3.4)

given the likelihood function of Equation (3.3) and a parameter prior . For brevity, the parameter posterior density is alternatively denoted by .

By integrating out parameters , the posterior predictive pmf of test label given test input and training dataset becomes

(3.5)

where is the likelihood function of Equation (3.3) evaluated on , and is the parameter posterior density of Equation (3.4). The integral in Equation (3.5) can be approximated via Monte Carlo integration, yielding the approximate posterior predictive pmf

(3.6)

where is a Markov chain realization obtained from the parameter posterior density . Maximizing the approximate posterior predictive pmf of Equation (3.6) yields the prediction

(3.7)

for test label .

The likelihood function for an MLP model with output layer nodes, as stated in Equation (3.3), is suited for multiclass classification with classes. For binary classification, which involves two classes, Equation (3.3) is related to an MLP with output layer nodes. There is an alternative likelihood function based on an MLP model with a single output layer node, which can be used for binary classification; see Papamarkou et al. (2022) for details.

3.2 Blocked Gibbs sampling

A blocked Gibbs sampling algorithm samples groups (blocks) of two or more parameters conditioned on all other other parameters, rather than sampling each parameter individually. The choice of parameter groups affects the rate of convergence (Roberts and Sahu, 1997). For instance, breaking down the parameter space into statistically independent groups of correlated parameters speeds up convergence.

To sample from the parameter posterior density of an model fitted to a training dataset , a blocked Gibbs sampling algorithm utilizes a partition of the MLP parameters . Due to partitioning , the parameter subsets are pairwise disjoint and satisfy . Without loss of generality, it is assumed that each subset of is totally ordered. For any such that , the shorthand notation is used hereafter. So, the vector is a permutation of .

Under such a setup, Algorithm 1 summarizes blocked Gibbs sampling. At iteration , for each , a blocked Gibbs sampling algorithm draws a sample of parameter group from the corresponding conditional density . To put it another way, at each iteration, a sample is drawn from the conditional density of each parameter group conditioned on the most recent values of the other parameter groups and on the training dataset.

1:Input: training dataset
2:Input: initial state
3:Input: number of Gibbs sampling iterations
4:for  do
5:     Draw
6:     Draw
7:     Draw
8:     Draw
9:end for
Algorithm 1 Blocked Gibbs sampling

4 Methodology

This section introduces a blocked Gibbs sampling algorithm for MLPs in supervised classification. MLP parameter blocks are determined by linking parameters to MLP nodes, as elaborated in Subsections  4.1 and 4.2 and as exemplified in Subsections  4.3 and 4.4.

Minibatching and parameter blocking render the proposed Gibbs sampler possible. Blocked Gibbs sampling is typically motivated by increased rates of convergence attained via near-optimal or optimal parameter groupings. Although low speed of convergence is a problem with MCMC in deep learning, near-zero acceptance rates constitute a more immediate problem. In other words, no mixing is a more pressing issue than slow mixing. By updating a small block of parameters at a time instead of updating all parameters via a single step, each block-specific acceptance rate moves away from zero. So, minibatch blocked Gibbs sampling provides a workaround for vanishing acceptance rates in deep learning. Of course there is no free lunch; increased acceptance rates come at a computational price per Gibbs step, which consists of additional conditional density sampling sub-steps.

SG-LD and SG-HMC implementations sample all parameters at once or sample parameters layer-wise. In the latter case, one block of parameters is formed for each MLP layer, and the resulting algorithm is LD-within-Gibbs or HMC-within-Gibbs. A caveat to grouping parameters by MLP layer is that parameter block sizes depend on layer widths. Hence, a parameter block can be large, containing hundreds or thousands of parameters, in which case the problem of low acceptance rate is not resolved. The blocked Gibbs sampler of this paper groups parameters by MLP node and allows to further partition parameters into smaller blocks within each node, thus controlling the number of parameters per block.

While structured SG-MCMC (Alexos, Boyd and Mandt, 2022) also splits the parameter space into blocks, it uses the parameter blocks to factorize a variational posterior density. Hence, structured SG-MCMC aims to solve the low acceptance and slow mixing problems by factorizing an approximate parameter posterior density. The blocked Gibbs sampler herein factorizes the exact parameter posterior density, relying on finer parameter grouping. Minibatching, which is the only type of approximation employed by the blocked Gibbs sampler of this paper, is an approximation related to the data, not to the MLP model.

The finer node-blocked Gibbs sampler for deep learning, as presently conceived here, is a gradient-free minibatch MCMC algorithm, so it does not belong to the SG-MCMC family. Moreover, it does not use tempering or any optimized tuning or scheduling of proposal hyperperameters.

4.1 Blocked Gibbs sampling via cross-entropy

Algorithm 1 raises the question how to sample each parameter block from its conditional density. Such conditional densities for MLPs are not available in closed form. Instead, a single Metropolis-Hastings step can be taken to draw a sample from a conditional density. In this case, Algorithm 1 becomes a Metropolis-within-blocked-Gibbs (MWBG) sampling algorithm.

At iteration of MWBG, a candidate state for parameter block can be sampled from an isotropic normal proposal density centered at state of iteration , where is the identity matrix, is the number of parameters in block , and is the proposal variance for block . Proposition 1 and Corollary 1 provide expressions for the acceptance probability of candidate state . The proofs of Proposition 1 and Corollary 1 are available in Appendix A: proofs.

Proposition 1.

Consider an with likelihood function specified by Equation (3.3), where is a training dataset related to a supervised classification problem and are the MLP parameters. Let be a parameter prior density based on a partition of . A MWBG version of Algorithm 1 is used for sampling from the target density . At iteration , a candidate state for parameter block is drawn from the isotropic normal proposal density . The acceptance probability of is given by

(4.1)

where and denote the values of obtained by inverting the permutations and , respectively.

Corollary 1.

Consider an with cross-entropy loss function , where is a training dataset related to a supervised classification problem and are the MLP parameters. It is assumed that is unnormalized, which means that it is not scaled by batch size. Under the sampling setup of Proposition 1, the acceptance probability of , expressed in terms of cross-entropy loss function , is given by

(4.2)

Proposition 1 states the acceptance probability in statistical terms using the likelihood function, whereas Corollary 1 states it in deep learning terms using the cross-entropy loss function. Corollary 1 is practical in the sense that deep learning software frameworks, being geared towards optimization, provide implementations of cross-entropy loss. For example, the unnormalized cross-entropy loss , as stated in Equation (6.4) of Appendix A: proofs, can be computed in PyTorch via the CrossEntropyLoss class initialized with reduction=\textquotesinglesum\textquotesingle.

Algorithm 2 summarizes exact MWBG sampling. To make Algorithm 2 amenable to big data, minibatching can be used by replacing all instances of with , where is a function from to its power set . If is the identity function, then exact MWBG sampling is performed. If returns batches (strict subsets of ), then the resulting approximate MCMC algorithm is termed ‘minibatch MWBG sampling’.

1:Input: training dataset
2:Input: initial state
3:Input: proposal variances across blocks
4:Input: number of Gibbs sampling iterations
5:for   do
6:     for   do
7:         Draw
8:         Compute
9:         Draw from uniform
10:         if  then
11:              Set
12:         else
13:              Set
14:         end if
15:     end for
16:end for
Algorithm 2 Metropolis-within-blocked-Gibbs (MWBG) sampling based on cross-entropy

4.2 Finer node-blocked Gibbs sampling

Big data and big models challenge the adaptation of MCMC sampling methods in deep learning. Minibatching provides a way of applying MCMC to big data. It is less clear how to apply MCMC to big neural network models, containing thousands or millions of parameters. Minibatch MWBG sampling proposes a way forward by drawing an analogy between subsetting data and subsetting model parameters. As data batches reduce the dimensionality of data per Gibbs sampling iteration, parameter blocks reduce the dimensionality of parameters per Metropolis-within-Gibbs update.

In an with parameters, layer contains parameters, of which are weights and are biases. So, if parameters are grouped by layer, then the block of layer contains parameters. The number of parameters in the block of layer grows linearly with the number of nodes in layer as well as linearly with the number of nodes in layer .

If parameters are grouped by node, then each node block in layer contains , of which are weights and one is bias. The number of parameters in a node block in layer does not depend on the number of nodes in layer , but it grows linearly with the number of nodes in layer . MWBG sampling (Algorithm 2) based on parameter grouping by MLP node is termed ‘(Metropolis-within-)node-blocked-Gibbs (NBG) sampling’.

Finer parameter blocks of smaller size can be generated by splitting the parameters of a node in layer into subgroups. In this case, each finer parameter block in each node in layer contains parameters. If hyperparameter is chosen to be a linear function of , then the number of parameters per finer block per node in layer depends neither on the number of nodes in layer nor on the number of nodes in layer . MWBG sampling (Algorithm 2) based on finer parameter grouping per node is termed ‘(Metropolis-within-)finer-node-blocked-Gibbs (FNBG) sampling’.

4.3 Toy example of finer node-blocking

The architecture shown in Figure 1 provides a toy example that showcases layer-based, node-based and finer node-based parameter grouping (more briefly termed ‘layer-blocking’, ‘node-blocking’ and ‘finer node-blocking’). It is reminded that finer node-based grouping refers to parameter grouping into smaller blocks within each node. Figure 2 shows the directed acyclic graph (DAG) representation of , augmenting Figure 1 with parameter annotations and with a layer consisting of a single node that represents label . Yellow shapes indicate parameters; yellow circles and boxes correspond to biases and weights. Yellow boxes adhere to expository visual conventions of plate models, with each box representing a set of weights. Purple nodes indicate observed variables (input and output data), whereas blue and gray nodes indicate latent variables (post-activations).

Figure 2: Visual demonstration of node-based parameter blocking for the architecture. The MLP is expressed as a DAG. Yellow nodes and yellow plates correspond to biases and weights. Each of the blue hidden layer nodes and of the gray output layer nodes is assigned a parameter block of yellow parent nodes in the DAG.

Layer-blocking partitions the set of parameters of to three blocks which contain parameters. For instance, the first hidden layer induces block , where .

Node-blocking partitions the set of parameters of to six blocks, as many as the number of hidden and output layer nodes. Each blue or gray node in a hidden layer or in the output layer has its own distinct set of yellow weight and bias parents. Parameters are grouped according to shared parenthood. For instance, the parameters of block , have node as a common child.

Figure 2 facilitates a visual explanation of Proposition 1. Acceptance probabilities for parameter blocks require likelihood function evaluations. It is not possible to factorize conditional densities to achieve more computationally efficient block updates. For instance, as it can be seen in Figure 2, changes in block induced by node in layer propagate through subsequent layers due to the hierarchical MLP structure, thus prohibiting a factorization of conditional density . More formally, each pair of node-based parameter blocks forms a v-structure, having label (purple node) as a descendant. Since training label is observed, such v-structures are activated, and therefore any two node-based parameter blocks are not conditionally independent given label .

As a demonstration of finer node-blocking for , set in layer . For , blocks and are generated within node . Similarly, blocks and are generated within node .

To recap on this toy example, layer-based grouping produces a single block of eight parameters in layer , node-based grouping produces two blocks of four parameters each in layer , and a case of finer node-based grouping produces four blocks of two parameters each in layer . It is thus illustrated that finer blocks per node provide a way to reduce the number of parameters per Gibbs sampling block.

4.4 MNIST example of finer node-blocking

After having used as a toy example to describe the basics of finer node-blocking, the wider architecture is utilized to elaborate on the practical relevance of smaller blocks per node. An is fitted to the MNIST (and FMNIST) training dataset in Section 5. An contains parameters, of which and have children nodes in the first, second, third hidden layer and output layer, respectively.

So, layer-blocking for involves four parameter blocks of sizes . Metropolis-within-Gibbs updates for block have zero or near-zero acceptance rate due to the large block size of . Although each of blocks has nearly two orders of magnitude smaller size than , a block size of might be large enough to yield Metropolis-within-Gibbs updates with prohibitively low acceptance rate.

Node-blocking for entails a block of parameters for each node in the first hidden layer, and a block of parameters for each node in the second and third hidden layer and in the output layer. Thus, node-blocking addresses the low acceptance rate problem related to large parameter blocks for block updates in all layers apart from the first hidden layer.

There is no practical need to carry out finer node-blocking in nodes belonging to the second or third hidden layer or to the output layer of , since each block in these layers contains only parameters based on node-blocking. On the other hand, finer node-blocking is useful in nodes belonging to the first hidden layer, since each block related to such nodes contains a large number of parameters. By setting , smaller blocks (each consisting of or parameters) are generated in the first hidden layer. So, finer node-blocking disentangles block sizes in the first hidden layer from input data dimensions, making it possible to decrease block sizes and to consequently increase acceptance rates.

5 Experiments

Minibatch FNBG sampling is put into practice to make empirical observations about several characteristics of approximate MCMC in deep learning. In the experiments of this section, parameters of MLPs are sampled. Three datasets are used, namely a simulated noisy version of exclusive-or (Papamarkou et al., 2022), MNIST (Lecun et al., 1998) and fashion MNIST (Xiao, Rasul and Vollgraf, 2017). For brevity, exclusive-or and fashion MNIST are abbreviated to XOR and FMNIST. Table 1 displays the correspondence between used datasets and fitted MLPs.

Dataset Neural network
Name Sample size Architecture # parameters
Training Test
Noisy XOR
Noisy XOR
MNIST
FMNIST
Table 1: Datasets used in the experiments and MLPs fitted to these datasets. Training and test dataset sample sizes as well as MLP parameter dimensions are shown.

The noisy XOR training and test datasets are visualized in Figure 9 of Appendix B: noisy XOR dataset. Random perturbations of and of , corresponding to gray and yellow points, are mapped to (circles). Moreover, random perturbations of and of , corresponding to purple and blue points, are mapped to (triangles). More information about the simulation of noisy XOR can be found in Papamarkou et al. (2022).

Each MNIST and FMNIST image is firstly reshaped, by converting it from a matrix to a vector of length , and it is subsequently standardized. This image reshaping explains why the model, which is fitted to MNIST and FMNIST, has an input layer width of .

5.1 Experimental configuration

Binary classification for noisy XOR is performed via the likelihood function based on binary cross-entropy, as described in Papamarkou et al. (2022). Multiclass classification for MNIST and FMNIST is performed via the likelihood function given by Equation (3.3), which is based on cross-entropy.

The sigmoid activation function is applied at each hidden layer of each MLP of Table 1. Furthermore, the sigmoid activation function is also applied at the output layer of and of , conforming to the employed likelihood function for binary classification. The softmax activation function is applied at the output layer of , in accordance with likelihood function (3.3) for multiclass classification. The same model is fitted to the MNIST and FMNIST datasets.

A normal prior is adopted for the parameters of each MLP model shown in Table 1. A relatively high variance, equal to , is assigned a priori to each coordinate of via the isotropic covariance matrix .

NBG sampling is run upon fitting and to the noisy XOR training set, while FNBG sampling is run upon fitting to the MNIST and FMNIST training sets. So, parameters are grouped by node in and , whereas multiple parameter groups per node are formed in the first hidden layer of as elaborated in Subsection 4.4. Parameters are grouped by node from the second hidden layer onwards in . All three MLPs of Table 1 are relatively shallow neural networks. However, has two orders of magnitude larger input layer width in comparison to and . So, the higher dimension of MNIST and FMNIST input data necessitates finer node-blocking in the first hidden layer of . On the other hand, the smaller dimension of noisy XOR input data implies that finer blocks per node are not required in the first hidden layer of or of .

A normal proposal density is chosen for each parameter block. The variance of each proposal density is a hyperparameter, thus enabling to tune the magnitude of proposal steps separately for each parameter block. Proposal variances are tuned empirically.

Markov chains are realized for noisy XOR, whereas chain is realized for each of MNIST and FMNIST due to computational resource limitations. iterations are run per chain realization, of which are discarded as burn-in. Thereby, post-burnin iterations are retained per chain realization. Acceptance rates are computed from all post-burnin iterations per chain.

Monte Carlo approximations of posterior predictive pmfs are computed according to Equation (3.6) for each data point of each test set. To reduce the computational cost, the last iterations of each realized chain are used in Equation (3.6).

Predictions for noisy XOR are made using the binary classification rule mentioned in Papamarkou et al. (2022). Predictions for MNIST and for FMIST are made using the multiclass classification rule specified by Equation (3.7). Given a single chain realization based on a training set, predictions are made for every point in the corresponding test set; the predictive accuracy is then computed as the number of correct predictions over the total number of points in the test set. For the noisy XOR test set, the mean of predictive accuracies across the realized chains is reported. For the MNIST and FMNIST test sets, the predictive accuracy based on the corresponding single chain realization () is reported.

5.2 Exact versus approximate MCMC

An illustrative comparison between approximate and exact NBG sampling is made in terms of acceptance rate, predictive accuracy and runtime. The comparison between approximate and exact NBG sampling is carried out in the context of noisy XOR only, since exact MCMC is not feasible for the MNIST and FMNIST examples due to vanishing acceptance rates and high computational requirements.

is fitted to the noisy XOR training set under four scenarios. For scenario , approximate NBG sampling is run with a batch size of to simulate chains. For scenario , exact NBG is run with a batch size of to simulate chains. For scenario , exact NBG is run until chains are obtained, each having an acceptance rate . For scenario , exact NBG is run until chains are acquired, each with an acceptance rate . and chains have been run in total under scenarios and , respectively, to get chains that satisfy the acceptance rate lower bounds in each scenario.

For approximate NBG sampling (scenario ), the proposal variance is set to . For the three exact NBG sampling scenarios, the proposal variance is lowered to in order to mitigate decreased acceptance rates in the presence of increased sample size ( training data points) relatively to the batch size of used in approximate sampling.

(a) Acceptance rate boxplots. The left and right boxplot in each pair correspond to approximate and exact NBG.
(b) Predictive accuracy boxplots.
(c) Runtime barplot.
Figure 3: A comparison between approximate and exact NBG sampling. is fitted to noisy XOR under four scenarios, acquiring chains per scenario. Scenario : approximate NBG with a batch size of . Scenario : exact NBG. Scenario : exact NBG with acceptance rate . Scenario : exact NBG with acceptance rate . Chains with acceptance rates below in scenario and below in scenario are discarded until chains are attained in each case.

Figure 2(a) displays boxplots of node-specific acceptance rates for approximate and exact NBG sampling without lower bound conditions on acceptance rates (scenarios and ). A pair of boxplots is shown for each of the nodes in the six hidden layers and one output layer of . The left and right boxplots per pair correspond to approximate and exact NBG sampling. Blue lines represent medians.

Three empirical observations are drawn from Figure 2(a). First of all, approximate NBG attains higher acceptance rates than exact NBG according to the (blue) medians, despite setting higher proposal variance in the former in comparison to the latter ( and , respectively). Secondly, approximate NBG attains less volatile acceptance rates than exact NBG as seen from the boxplot interquartile ranges. Acceptance rates for exact NBG range from near to about as neural network depth increases, exhibiting lack of stability due to entrapment in local modes in some chain realizations. Thirdly, acceptance rates decrease as depth increases. For instance, exact NBG yields median acceptance rates of and in nodes and , respectively. The attenuation of acceptance rate with depth is further discussed in Subsection 5.3.

Figure 2(b) shows boxplots of predictive accuracies for the four scenarios under consideration. Approximate NBG has a median predictive accuracy of , with interquartile range concentrated around the median and with a single outlier () in chain realizations. Exact NBG without conditions on acceptance rate and exact NBG conditioned on acceptance rate have lower median predictive accuracies ( and ) and higher interquartile ranges than exact NBG. Exact NBG conditioned on acceptance rate attains a median predictive accuracy of ; nine out of chain realizations yield accuracy, and one chain gives an outlier accuracy of . The overall conclusion is that approximate NBG retains a predictive advantage over exact NBG, since minibatch sampling ensures consistency in terms of high predictive accuracy and reduced predictive variability. Exact NBG conditioned on higher acceptance rates can yield near-perfect predictive accuracy in the low parameter and data dimensions of the toy noisy XOR example, but stability and computational issues arise, as many chains with near-zero acceptance rates are discarded before chains with the required level of acceptance rate () are obtained.

Figure 2(c) shows a barplot of runtimes (in hours) for the four scenarios under consideration. Purple bars represent runtimes for the retained chains per scenario, whereas gray bars indicate runtimes for the chains that have been discarded due to unmet acceptance rate requirements. As seen from a comparison between purple bars, approximate NBG has shorter runtime (for retained chains of same length) than exact NBG, which is explained by the fact that minibatching uses a subset of the training set at each approximate NBG iteration. A comparison between gray bars in scenarios and demonstrates that exact NBG runtimes for discarded chains increase with increasing acceptance rate lower bounds. By observing Figures 2(b) and 2(c) jointly, it is pointed out that predictive accuracy improvements of exact NBG (arising from higher acceptance rate lower bounds) come at higher computational costs.

5.3 Effect of depth on acceptance rate

Figure 4 displays mean acceptance rates across chains realized via minibatch NBG upon fitting to noisy XOR. In particular, Figure 3(a) shows the mean acceptance rate for each node in the six hidden layers and one output layer of , while Figure 3(b) shows the mean acceptance rate for each of these seven (six hidden and one output) layers. A batch size of is used for minibatch NBG. The same set of chains have been used in Figures 3 and 4.

(a) Mean acceptance rate per node.
(b) Mean acceptance rate per layer.
Figure 4: Mean acceptance rates (per node and per layer) across chains realized via minibatch NBG sampling of the parameters. The MLP is fitted to noisy XOR. A batch size of is used.

Figures 2(a) and 3(a) provide alternative views of node-specific acceptance rates. The former figure represents such information via boxplots and medians, whereas the latter makes use of a barplot of associated means.

Figure 4 demonstrates that if the proposal variance is the same for all parameter blocks across layers, then the acceptance rate reduces with depth. For instance, it can be seen in Figure 3(b) that the acceptance rates for hidden layers , and are , and , respectively.

Using a common proposal variance for all parameter blocks across layers generates disparities in acceptance rates, with higher rates in shallower layers and lower rates in deeper layers. These disparities become more pronounced with big data or with high parameter dimensions. For example, sampling parameters with the same proposal variance in all parameter blocks is not feasible in the case of MNIST or FMNIST; the acceptance rates are high in the first hidden layer and drop near zero in the output layer. FNBG sampling enables to reduce the proposal variance for deeper layers, thus avoiding vanishing acceptance rates with increasing depth.

Tables 5 and 6 of Appendix C: tuning per layer exemplify empirically tuned proposal variances for minibatch FNBG sampling of parameters in the respective cases of MNIST and FMNIST. Batch sizes of and are employed, corresponding to and of the MNIST and FMNIST training sets. For each of these four batch sizes and for each training set, the proposal variance per layer is tuned empirically, and subsequently the acceptance rate per layer is computed from a chain realization. Tables 5 and 6 demonstrate that if proposal variances are reduced in deeper layers, then acceptance rates do not vanish with depth. For increasing batch size, acceptance rates drop across all layers, as expected when shifting from approximate towards exact MCMC.

As part of Table 5, a chain is simulated upon fitting to the MNIST training set via minibatch FNBG sampling with a batch size of . Figure 5, which comprises a grid of traceplots, is produced from that chain. Each row of Figure 5 is related to one of the parameters of . More specifically, the first, second, third and fourth row correspond to parameter in hidden layer , parameter in hidden layer , parameter in hidden layer and parameter in the output layer. A pair of traceplots per parameter is shown in each row; the right traceplot is more zoomed out than the left one. All traceplots in the right column share a common range of in their vertical axes.

Figure 5: Markov chain traceplots of four parameter coordinates of , which is fitted to MNIST via minibatch FNBG sampling with a batch size of . Each row displays two traceplots of the same chain for a single parameter; the traceplot on the right is more zoomed-out than the one on the left. The traceplots of the right column share a common range on the vertical axes. Vertical dotted lines indicate the end of burnin.

It is observed that the zoomed-in traceplots (left column of Figure 5) do not exhibit entrapment in local modes irrespective of network depth, agreeing with the non-vanishing acceptance rates of Table 5. Furthermore, it is seen from the zoomed-out traceplots (right column of Figure 5) that chain scales decrease in deeper layers. For example, the right traceplot of parameter (output layer) has non-visible fluctuations under a y-axis range of , whereas the right traceplot of parameter (first hidden layer) fluctuates more widely under the same y-axis range.

Figure 5 suggests that chains of parameters in shallower layers perform more exploration, while chains of parameters in deeper layers carry out more exploitation. This way, chain scales collapse towards point estimates for increasing network depth.

5.4 Effect of batch size on log-likelihood

For each batch size shown in Figure 5(a), the likelihood function of Equation (3.3) is evaluated on batch samples, which are drawn from the MNIST training set. A boxplot is then generated from the log-likelihood values and it is displayed in Figure 5(a). The log-likelihood function is normalized by batch size in order to obtain visually comparable boxplots across different batch sizes. In PyTorch, the normalized log-likelihood is computed via the CrossEntropyLoss class initialized with reduction=\textquotesinglemean\textquotesingle. In each boxplot, the blue line and yellow point correspond to the median and mean of the associated log-likelihood values. The horizontal gray line represents the log-likelihood value based on the whole MNIST training set. Figure 5(b) is generated using the FMNIST training set, following an analogous setup.

(a) Log-likelihood value boxplots for MNIST.
(b) Log-likelihood value boxplots for FMNIST.
Figure 6: Boxplots of normalized log-likelihood values for MNIST and FMNIST. Each boxplot summarizes normalized log-likelihood values of batch samples for a given batch size. To normalize, each log-likelihood value is divided by batch size. Blue lines and yellow points correspond to medians and means. Horizontal gray lines represent exact log-likelihood values for batch size equal to training sample size.

Figures 5(a) and 5(b) demonstrate that log-likelihood values are increasingly volatile for decreasing batch size. Furthermore, the volatility of log-likelihood values vanishes as the batch size gets close to the training sample size. So, Figure 6 confirms visually that the approximate likelihood tends to the exact likelihood for increasing batch size. Thus, the batch size in FNBG sampling is preferred to be as large as possible, up to the point that (finer) block acceptance rates do not become prohibitively low.

5.5 Effect of depth on prediction

Figure 7 explores how network depth affects predictive accuracy in approximate MCMC. Shallower , consisting of one hidden layer, and deeper , consisting of six hidden layers, are fitted to the noisy XOR training set using minibatch NBG with a batch size of and a proposal variance of ; chains are realized for each of the two MLPs. Subsequently, the predictive accuracy per chain is evaluated on the noisy XOR test set. One boxplot is generated for each set of chains, as shown in Figure 7. Blue lines represent medians.

Figure 7: A comparison between a shallower and a deeper MLP architecture. Each of and is fitted to noisy XOR via minibatch NBG sampling with a batch size of . Predictive accuracy boxplots are generated from chains per MLP. Blue lines indicate medians.

The same chains are used to generate relevant plots in Figures 2(b),  4 and 7. In particular, the leftmost boxplot in Figure 2(b) and right boxplot in Figure 7 stem from the same chains and are thus identical. Figure 4 shows mean acceptance rates per node and per layer across the chains that also yield the right boxplot of predictive accuracies in Figure 7.

and have respective predictive accuracy medians of and as blue lines indicate in Figure 7, so predictive accuracy increases with increasing depth. Moreover, the interquartile ranges of Figure 7 demonstrate that a deeper architecture yields less volatile, and in that sense more stable, predictive accuracy. As an overall empirical observation, increasing the network depth in approximate MCMC seems to produce higher and less volatile predictive accuracy.

5.6 Effect of batch size on prediction

This subsection assesses empirically the effect of batch size on predictive accuracy in approximate MCMC. To this end, is fitted to the MNIST and FMNIST training sets using minibatch FNBG sampling with batch sizes of , , and , which correspond to , , and of each training sample size. One chain is realized per combination of training set and batch size. Table 2 reports the predictive accuracy for each chain.

Dataset Batch size
1% 3% 5% 7%
0.6K 1.8K 3K 4.2K
MNIST 85.99 89.01 90.75 90.43
FMNIST 71.50 80.07 80.89 79.17
Table 2: Predictive accuracies obtained by fitting to MNIST and to FMNIST via minibatch FNBG sampling with different batch sizes.

The same chains are used to compute predictive accuracies in Table 2 as well as acceptance rates in Tables 5 and 6 of Appendix C: tuning per layer. The chain that yields the predictive accuracy for MNIST and for a batch size of (first row and third column of Table 2) is partly visualized by traceplots in Figure 5.

According to Table 2, the highest accuracy of for MNIST and of for FMNIST are attained by employing a batch size of . Overall, predictive accuracy increases as batch size increases. However, predictive accuracy decreases when batch size increases from to ; this is explained by the fact that a batch size of is too large, in the sense that it reduces acceptance rates (see Tables 5 and 6). So, as pointed out in Subsection 5.4, a tuning guideline is to increase the batch size up to the point that no substantial reduction in finer block acceptance rates occurs.

An attained predictive accuracy of on MNIST demonstrates that non-convergent chains (simulated via minibatch FNBG) learn from data, since data-agnostic guessing based on pure chance has a predictive accuracy of . While stochastic optimisation algorithms for deep learning achieve predictive accuracies higher than on MNIST, the goal of this work has not been to construct an approximate MCMC algorithm that outperforms stochastic optimisation on the predictive front. The main objective has been to demonstrate that approximate MCMC for neural networks learns from data and to uncover associated sampling characteristics, such as diminishing chain ranges (Figure 5) and diminishing acceptance rates (Tables 5 and 6) for increasing network depth. Similar predictive accuracies in the vicinity of using Hamiltonian Monte Carlo for deep learning have been reported in the literature (Wenzel et al., 2020; Izmailov et al., 2021). Nonetheless, this body of relevant work relies on chain lengths one or two orders of magnitude shorter. The present paper proposes to circumvent vanishing acceptance rates by grouping network parameters into smaller blocks, thus enabling to generate lengthier chains.

5.7 Effect of chain length on prediction

It is reminded that iterations are run per chain in the experiments herein, of which the first are discarded as burnin. The last (out of the remaining ) iterations are used for making predictions via Bayesian marginalization based on Equation (3.6). Only iterations are utilized in Equation (3.6) to cap the computational cost for predictions.

There exists a tractable solution to Bayesian marginalization, since the approximate posterior predictive pmf of Equation (3.6) can be computed in parallel both in terms of Monte Carlo iterations and of test points. The implementation of such a parallel solution is deferred to future work.

In the meantime, it is examined here how chain length affects predictive accuracy. Along these lines, predictive accuracies are computed from the last , , and iterations of the chain realized via minibatch FNBG with a batch size of for each of MNIST and FMNIST (see Table 3). The last and all post-burnin iterations of the same chain generate predictive accuracies in Table 2 and acceptance rates in Tables 5 and 6, respectively.

Dataset Chain length
1K 10K 20K 30K
MNIST 88.31 90.75 91.12 91.20
FMNIST 78.93 80.89 81.36 81.53
Table 3: Predictive accuracies obtained from different chain lengths. is fitted to MNIST and to FMNIST via minibatch FNBG sampling with a batch size of . One chain is realized per dataset. Subsequently, predictions are made via Bayesian marginalization using chunks of different length from the end of the realized chains.

Table 3 demonstrates that predictive accuracy increases (both for MNIST and FMNIST) as chain length increases. So, as a chain traverses the parameter space of a neural network, information of predictive importance accrues despite the lack of convergence. It can also be seen from Table 3 that the rate of improvement in predictive accuracy slows down for increasing chain length.

5.8 Effect of data augmentation on prediction

To assess the effect of data augmentation on predictive accuracy, three image transformations are performed on the MNIST and FMNIST training sets, namely rotations by angle, blurring, and colour inversions. Images are rotated by angles randomly selected between and degrees. Each image is blurred with probability . Blur is randomly generated from a Gaussian kernel of size . The standard deviation of the kernel is randomly selected between and . Each image is colour-inverted with probability . Figure 10 in Appendix D: data augmentation displays examples of MNIST and FMNIST training images that have been rotated, blurred or colour-inverted according to the described transformations.

Each of the three transformations is applied to the whole MNIST and FMNIST training sets. Subsequently, is fitted to each transformed training set via minibatch FNBG with a batch size of and with proposal variances specified in Tables 5 and 6. One chain is simulated per transformed training set. Predictive accuracies are computed on the corresponding untransformed MNIST and FMNIST test sets and are reported in Table 4. Moreover, predictive accuracies based on the untransformed MNIST and FMNIST training sets are available in the first column of Table 4, as previously reported in Table 2.

Dataset Transform
None Rotation Blur Inversion
MNIST 90.75 86.19 85.66 36.87
FMNIST 80.89 6.62 7.46 8.61
Table 4: Predictive accuracies obtained from different data augmentation schemes. is fitted to each of the augmented MNIST and FMNIST training sets via minibatch FNBG sampling with a batch size of . Predictive accuracies are computed on the corresponding non-augmented test sets. The first column reports predictive accuracies based on the non-augmented MNIST and FMNIST training sets.

According to Table 4, if data augmentation is performed, then predictive accuracy deteriorates drastically. Notably, data augmentation has catastrophic predictive consequences for FMNIST. These empirical findings agree with the ‘dirty likelihood hypothesis’ of Wenzel et al. (2020), according to which data augmentation violates the likelihood principle.

5.9 Uncertainty quantification

Approximate MCMC enables predictive uncertainty quantification (UQ) via Bayesian marginalization. Such a principled approach to UQ constitutes an advantage of approximate MCMC over stochastic optimization in deep learning. This subsection showcases how predictive uncertainty is quantified for neural networks via minibatch FNBG sampling.

Recall that one chain has been simulated for each of MNIST and FMNIST to compute the predictive accuracies of column in Table 2 (see Subsection 5.6). Those chains are used to estimate posterior predictive probabilities for some images in the corresponding test sets, as shown in Figure 8. All test images in Figure 8 have been correctly classified via Bayesian marginalization.

(a) Predictive posterior probabilities for MNIST.
(b) Predictive posterior probabilities for FMNIST.
Figure 8: Demonstration of UQ for some correctly classified MNIST and FMNIST test images. The highest predictive posterior probability is displayed for each image associated with low uncertainty, whereas the two highest predictive posterior probabilities are displayed for each image associated with high uncertainty.

The first and second MNIST test images in Figure 7(a) show numbers and , with corresponding posterior predictive probabilities and that indicate near-certainty about the classification outcomes. The third MNIST test image in Figure 7(a) shows number . Attempting to classify this image by eye casts doubt as to whether the number in the image is or . While Bayesian marginalization correctly classifies the number as , the posterior predictive probability is relatively low, indicating uncertainty in the prediction. Moreover, the second highest posterior predictive probability identifies number as a probable alternative, in agreement with human perception. All in all, posterior predictive probabilities and human understanding are aligned in terms of perceived predictive uncertainties and in terms of plausible classification outcomes. Image is aligned with image of Figure 7(a) regarding UQ conclusions.

Figure 7(b), which entails FMNIST test images, is analogous to Figure 7(a) from a UQ point of view. In Figure 7(b), FMNIST test images and show trousers and a bag, with corresponding posterior predictive probabilities and that indicate near-certainty about the classification outcomes. The third FMNIST test image of Figure 7(b) shows a shirt. It is not visually clear whether this image depicts a shirt or a pullover. While Bayesian marginalization correctly identifies the object as a shirt, the posterior predictive probabilities and capture human uncertainty and identify the two most plausible classification outcomes. Image is analogous to image of Figure 7(b) in terms of UQ conclusions.

6 Future work

Several future research directions emerge from this paper; two software engineering extensions are planned, two methodological developments are proposed, and one theoretical question is posed.

To start with planned software engineering work, Bayesian marginalization will be parallelized across test points and across FNBG iterations per test point. Additionally, an adaptive version of FNBG sampling will be implemented based on existing Gibbs sampling methods for proposal variance tuning, thus automating tuning and reducing tuning computational requirements.

In terms of methodological developments, alternative ways of grouping parameters in FNBG sampling will be considered. For example, parameters may be grouped according to their covariance structure, as estimated from pilot FNBG runs. Moreover, FNBG sampling will be developed for neural network architectures other than MLPs. To this end, DAG representations of other neural network architectures will be devised and fine parameter blocks will be identified from the DAGs.

A theoretical question of interest is how to construct lower bounds of predictive accuracy for minibatch FNBG (and for minibatch MCMC more generally) as a function of the distance between the exact and approximate parameter posterior density. It has been observed empirically that minibatch FNBG has predictive capacity, yet theoretical guarantees for predictive accuracy have not been established.

Software and Data

The FNBG sampler for MLPs has been implemented under the eeyore package using Python and PyTorch. eeyore is available at https://github.com/papamarkou/eeyore. Source code for the examples of Section 5 can be found in dmcl_examples, forming a separate Python package based on eeyore. dmcl_examples can be downloaded from https://github.com/papamarkou/dmcl_examples.

Appendix A: proofs

\sname

Appendix A

Proof of Proposition 1.

Since the proposal density is symmetric, the Metropolis-Hastings acceptance probability expresses as

(6.1)

According to the definition of conditional density, it holds that

(6.2)

By setting once and once in Equation (6.2) and by plugging the resulting expressions into Equation (6.1), it follows that

(6.3)

The proof is completed by combining Equations  (3.4), (6.3) and the assumed parameter prior density. ∎

Proof of Corollary 1.

It is recalled that the cross-entropy loss function expresses as

(6.4)

For brevity, is alternatively denoted by in the main text. It follows from Equations  (6.4) and (3.3) that

(6.5)

Replacing the likelihood function in Proposition 1 with Equation (6.5) completes the proof. ∎

Appendix B: noisy XOR dataset

\sname

Appendix B

Figure 9 shows the noisy XOR training and test datasets used in Section 5. Information about how these noisy XOR datasets have been simulated is available in Papamarkou et al. (2022).

Figure 9: Noisy XOR training set (left) and test set (right) consisting of and data points, respectively.

Appendix C: tuning per layer

\sname

Appendix C

Tables 5 and 6 show that acceptance rates obtained from minibatch FNBG sampling can be retained at non-vanishing levels in deeper layers by reducing the proposal variances corresponding to these layers. is fitted to MNIST and to FMNIST via minibatch FNBG sampling with different batch sizes. The acceptance rate per layer is computed from one chain for each batch size. Tables 5 and 6 report the obtained acceptance rates for MNIST and for FMNIST, respectively.

Layer Rate

Hidden

45.56
26.43
26.28
Output 29.18

Hidden

41.41
30.68
31.92
Output 35.66

Hidden

54.95
45.73
44.98
Output 51.54

Hidden

31.68
20.17
19.76
Output 22.22
Table 5: Acceptance rate per layer obtained by fitting to MNIST via minibatch FNBG sampling with different batch sizes.
Layer Rate

Hidden

47.86
34.61
32.99
Output 37.73

Hidden

60.34
46.78
45.91
Output 52.07

Hidden

66.94
57.40
58.48
Output 64.64

Hidden

55.28
47.10
47.19
Output 52.75
Table 6: Acceptance rate per layer obtained by fitting to FMNIST via minibatch FNBG sampling with different batch sizes.

Appendix D: data augmentation

\sname

Appendix D

Figure 10 shows examples of images from the MNIST and FMNIST training sets transformed by rotation, blurring and colour inversion. These transformations are used in Subsection 5.8 to assess the effect of data augmentation on predictive accuracy. Details about the performed transformations are available in Subsection 5.8.

(a) Examples of transformed MNIST training images.
(b) Examples of transformed FMNIST training images.
Figure 10: Examples of MNIST and of FMNIST training images transformed by rotation, blurring and colour inversion. Such transformations are deployed in the data augmentation experiments of Subsection 5.8. Examples of untransformed MNIST and FMNIST training images are also displayed.

Acknowledgements

The author would like to acknowledge the assistance given by Research IT and the use of the Computational Shared Facility at The University of Manchester. This work used the Cirrus UK National Tier-2 HPC Service at EPCC (http://www.cirrus.ac.uk) funded by the University of Edinburgh and EPSRC (EP/P020267/1). The author would like to thank Google for the provision of free credit on Google Cloud Platform.

This work was presented at two seminars supported by a travel grant from the Dame Kathleen Ollerenshaw Trust, which is gratefully acknowledged.

The author would like to dedicate this paper to the memory of his mother, who died as this paper was being developed.

References

  • Alexos, Boyd and Mandt (2022) {binproceedings}[author] \bauthor\bsnmAlexos, \bfnmAntonios\binitsA., \bauthor\bsnmBoyd, \bfnmAlex J\binitsA. J. \AND\bauthor\bsnmMandt, \bfnmStephan\binitsS. (\byear2022). \btitleStructured stochastic gradient MCMC. In \bbooktitleProceedings of the 39th International Conference on Machine Learning \bvolume162 \bpages414–434. \bpublisherPMLR. \endbibitem
  • Andrieu, de Freitas and Doucet (1999) {bmisc}[author] \bauthor\bsnmAndrieu, \bfnmC.\binitsC., \bauthor\bparticlede \bsnmFreitas, \bfnmJ. F. G.\binitsJ. F. G. \AND\bauthor\bsnmDoucet, \bfnmA.\binitsA. (\byear1999). \btitleSequential Bayesian estimation and model selection applied to neural networks. \endbibitem
  • Andrieu, de Freitas and Doucet (2000) {binproceedings}[author] \bauthor\bsnmAndrieu, \bfnmChristophe\binitsC., \bauthor\bparticlede \bsnmFreitas, \bfnmNando\binitsN. \AND\bauthor\bsnmDoucet, \bfnmArnaud\binitsA. (\byear2000). \btitleReversible jump MCMC simulated annealing for neural networks. In \bbooktitleProceedings of the 16th Conference on Uncertainty in Artificial Intelligence \bpages11–18. \endbibitem
  • Chen, Fox and Guestrin (2014) {binproceedings}[author] \bauthor\bsnmChen, \bfnmTianqi\binitsT., \bauthor\bsnmFox, \bfnmEmily\binitsE. \AND\bauthor\bsnmGuestrin, \bfnmCarlos\binitsC. (\byear2014). \btitleStochastic gradient Hamiltonian Monte Carlo. In \bbooktitleProceedings of the 31st International Conference on Machine Learning. \bseriesPMLR \bvolume32 \bpages1683–1691. \endbibitem
  • de Freitas (1999) {bphdthesis}[author] \bauthor\bparticlede \bsnmFreitas, \bfnmNando\binitsN. (\byear1999). \btitleBayesian methods for neural networks, \btypePhD thesis, \bpublisherUniversity of Cambridge. \endbibitem
  • de Freitas et al. (2001) {binbook}[author] \bauthor\bparticlede \bsnmFreitas, \bfnmN.\binitsN., \bauthor\bsnmAndrieu, \bfnmC.\binitsC., \bauthor\bsnmHøjen-Sørensen, \bfnmP.\binitsP., \bauthor\bsnmNiranjan, \bfnmM.\binitsM. \AND\bauthor\bsnmGee, \bfnmA.\binitsA. (\byear2001). \btitleSequential Monte Carlo methods for neural networks In \bbooktitleSequential Monte Carlo Methods in Practice \bpages359–379. \bpublisherSpringer New York. \endbibitem
  • Gong, Li and Hernández-Lobato (2019) {binproceedings}[author] \bauthor\bsnmGong, \bfnmWenbo\binitsW., \bauthor\bsnmLi, \bfnmYingzhen\binitsY. \AND\bauthor\bsnmHernández-Lobato, \bfnmJosé Miguel\binitsJ. M. (\byear2019). \btitleMeta-learning for stochastic gradient MCMC. In \bbooktitleInternational Conference on Learning Representations. \endbibitem
  • Hastie, Tibshirani and Friedman (2016) {bbook}[author] \bauthor\bsnmHastie, \bfnmTrevor\binitsT., \bauthor\bsnmTibshirani, \bfnmRobert\binitsR. \AND\bauthor\bsnmFriedman, \bfnmJerome\binitsJ. (\byear2016). \btitleThe elements of statistical learning: data mining, inference and prediction, \beditionsecond ed. \bpublisherSpringer. \endbibitem
  • He et al. (2016) {binproceedings}[author] \bauthor\bsnmHe, \bfnmKaiming\binitsK., \bauthor\bsnmZhang, \bfnmXiangyu\binitsX., \bauthor\bsnmRen, \bfnmShaoqing\binitsS. \AND\bauthor\bsnmSun, \bfnmJian\binitsJ. (\byear2016). \btitleDeep residual learning for image recognition. In \bbooktitle2016 IEEE Conference on Computer Vision and Pattern Recognition \bpages770–778. \endbibitem
  • Izmailov et al. (2021) {binproceedings}[author] \bauthor\bsnmIzmailov, \bfnmPavel\binitsP., \bauthor\bsnmVikram, \bfnmSharad\binitsS., \bauthor\bsnmHoffman, \bfnmMatthew D\binitsM. D. \AND\bauthor\bsnmWilson, \bfnmAndrew Gordon Gordon\binitsA. G. G. (\byear2021). \btitleWhat are Bayesian neural network posteriors really like? In \bbooktitleProceedings of the 38th International Conference on Machine Learning \bvolume139 \bpages4629–4640. \bpublisherPMLR. \endbibitem
  • Krizhevsky and Hinton (2009) {btechreport}[author] \bauthor\bsnmKrizhevsky, \bfnmAlex\binitsA. \AND\bauthor\bsnmHinton, \bfnmGeoffrey\binitsG. (\byear2009). \btitleLearning multiple layers of features from tiny images \btypeTechnical Report, \bpublisherUniversity of Toronto, \baddressToronto, Ontario. \endbibitem
  • Lecun et al. (1998) {barticle}[author] \bauthor\bsnmLecun, \bfnmY.\binitsY., \bauthor\bsnmBottou, \bfnmL.\binitsL., \bauthor\bsnmBengio, \bfnmY.\binitsY. \AND\bauthor\bsnmHaffner, \bfnmP.\binitsP. (\byear1998). \btitleGradient-based learning applied to document recognition. \bjournalProceedings of the IEEE \bvolume86 \bpages2278–2324. \endbibitem
  • Minsky and Papert (1988) {bbook}[author] \bauthor\bsnmMinsky, \bfnmMarvin L\binitsM. L. \AND\bauthor\bsnmPapert, \bfnmSeymour A\binitsS. A. (\byear1988). \btitlePerceptrons: expanded edition. \bpublisherMIT press. \endbibitem
  • Netzer et al. (2011) {binproceedings}[author] \bauthor\bsnmNetzer, \bfnmYuval\binitsY., \bauthor\bsnmWang, \bfnmTao\binitsT., \bauthor\bsnmCoates, \bfnmAdam\binitsA., \bauthor\bsnmBissacco, \bfnmAlessandro\binitsA., \bauthor\bsnmWu, \bfnmBo\binitsB. \AND\bauthor\bsnmNg, \bfnmAndrew Y.\binitsA. Y. (\byear2011). \btitleReading digits in natural images with unsupervised feature learning. In \bbooktitleNIPS Workshop on Deep Learning and Unsupervised Feature Learning. \endbibitem
  • Papamarkou et al. (2022) {barticle}[author] \bauthor\bsnmPapamarkou, \bfnmT.\binitsT., \bauthor\bsnmHinkle, \bfnmJ.\binitsJ., \bauthor\bsnmYoung, \bfnmM. T.\binitsM. T. \AND\bauthor\bsnmWomble, \bfnmD.\binitsD. (\byear2022). \btitleChallenges in Markov chain Monte Carlo for Bayesian neural networks. \bjournalStatistical Science \bvolume37 \bpages425–442. \endbibitem
  • Roberts and Sahu (1997) {barticle}[author] \bauthor\bsnmRoberts, \bfnmG. O.\binitsG. O. \AND\bauthor\bsnmSahu, \bfnmS. K.\binitsS. K. (\byear1997). \btitleUpdating schemes, correlation structure, blocking and parameterization for the Gibbs sampler. \bjournalJournal of the Royal Statistical Society: Series B (Statistical Methodology) \bvolume59 \bpages291–317. \endbibitem
  • Rosenblatt (1958) {barticle}[author] \bauthor\bsnmRosenblatt, \bfnmFrank\binitsF. (\byear1958). \btitleThe perceptron: a probabilistic model for information storage and organization in the brain. \bjournalPsychological review \bvolume65 \bpages386. \endbibitem
  • Saul and Jordan (1995) {binproceedings}[author] \bauthor\bsnmSaul, \bfnmLawrence\binitsL. \AND\bauthor\bsnmJordan, \bfnmMichael\binitsM. (\byear1995). \btitleExploiting Tractable Substructures in Intractable Networks. In \bbooktitleAdvances in Neural Information Processing Systems \bvolume8. \bpublisherMIT Press. \endbibitem
  • Welling and Teh (2011) {binproceedings}[author] \bauthor\bsnmWelling, \bfnmMax\binitsM. \AND\bauthor\bsnmTeh, \bfnmYee Whye\binitsY. W. (\byear2011). \btitleBayesian learning via stochastic gradient Langevin dynamics. In \bbooktitleProceedings of the 28th International Conference on International Conference on Machine Learning \bpages681–688. \bpublisherOmnipress. \endbibitem
  • Wenzel et al. (2020) {binproceedings}[author] \bauthor\bsnmWenzel, \bfnmFlorian\binitsF., \bauthor\bsnmRoth, \bfnmKevin\binitsK., \bauthor\bsnmVeeling, \bfnmBastiaan\binitsB., \bauthor\bsnmSwiatkowski, \bfnmJakub\binitsJ., \bauthor\bsnmTran, \bfnmLinh\binitsL., \bauthor\bsnmMandt, \bfnmStephan\binitsS., \bauthor\bsnmSnoek, \bfnmJasper\binitsJ., \bauthor\bsnmSalimans, \bfnmTim\binitsT., \bauthor\bsnmJenatton, \bfnmRodolphe\binitsR. \AND\bauthor\bsnmNowozin, \bfnmSebastian\binitsS. (\byear2020). \btitleHow good is the Bayes posterior in deep neural networks really? In \bbooktitleProceedings of the 37th International Conference on Machine Learning \bvolume119 \bpages10248–10259. \bpublisherPMLR. \endbibitem
  • Xiao, Rasul and Vollgraf (2017) {barticle}[author] \bauthor\bsnmXiao, \bfnmHan\binitsH., \bauthor\bsnmRasul, \bfnmKashif\binitsK. \AND\bauthor\bsnmVollgraf, \bfnmRoland\binitsR. (\byear2017). \btitleFashion-MNIST: a novel image dataset for benchmarking machine learning algorithms. \bjournalarXiv preprint arXiv:1708.07747. \endbibitem
  • Zhang et al. (2020) {binproceedings}[author] \bauthor\bsnmZhang, \bfnmRuqi\binitsR., \bauthor\bsnmLi, \bfnmChunyuan\binitsC., \bauthor\bsnmZhang, \bfnmJianyi\binitsJ., \bauthor\bsnmChen, \bfnmChangyou\binitsC. \AND\bauthor\bsnmWilson, \bfnmAndrew Gordon\binitsA. G. (\byear2020). \btitleCyclical stochastic gradient MCMC for Bayesian deep learning. In \bbooktitleInternational Conference on Learning Representations. \endbibitem