Title: MIXTURE DISTRIBUTIONS FOR SCALABLE BAYESIAN INFERENCE

Abstract: Bayesian Neural Networks (BNNs) provides a mathematically grounded framework to quantify uncertainty. However BNNs are computationally inefficient, thus are generally not employed on complicated machine learning tasks. Deep Ensembles were introduced as a Bootstrap inspired frequentist approach to the community, as an alternative to BNN's. Ensembles of deterministic and stochastic networks are a good uncertainty estimator in various applications (Although, they are criticized for not being Bayesian). We show Ensembles of deterministic and stochastic Neural Networks can indeed be cast as an approximate Bayesian inference. Deep Ensembles have another weakness of having high space complexity, we provide an alternative to it by modifying the original Bayes by Backprop (BBB) algorithm to learn more general concrete mixture distributions over weights. We show our methods and its variants can give better uncertainty estimates at a significantly lower parametric overhead than Deep Ensembles. We validate our hypothesis through experiments like non-linear regression, predictive uncertainty estimation, detecting adversarial images and exploration-exploitation trade-off in reinforcement learning.

1. INTRODUCTION:

Neural Networks models have been applied in diverse fields from weather forecasting, to autonomous vehicle driving, to online advertisement and many more (Goodfellow et al. (2016) ). However, vanilla feed-forward NNs are susceptible to the problem of over-fitting. In addition to this, NNs trained using Maximum Likelihood Estimation (MLE), or Maximum A Posteriori (MAP) cannot provide an estimate of the uncertainty in predicted value and tend to produce overconfident results on out-of-distribution test data. Thus we aim to build deep learning frameworks which are more robust, secure and reliable -specifically, in the face of uncertainty we would like the model to be able to say "I Don't Know!" A principled approach to build such models is through Bayesian inference, where instead of a point estimate for the network parameters, we infer the posterior distribution of the weights given the data. The predictive distribution of unseen data (x * , y * ) is given by q(y * |x * ) = p(y * |x * , W )p(W |D)dW , where p(W |D) is the true posterior computed from Bayes rule. Unfortunately, since modern NNs have an exponentially large number of parameters and do not lend themselves to being integrated into mathematical equations, exact inference remains intractable.

Several methods for approximate Bayesian inference have been investigated. Until now, Hamiltonian Monte Carlo (HMC) (Neal ( 2012)) has been considered the gold standard for approximate Bayesian inference. However, HMC requires explicit storage of samples from the posterior and is typically not scalable to larger networks and datasets. Thus methods based on Variational Inference (VI) have gained popularity recently for the task of approximate inference. VI relies on using a surrogate posterior (q θ (W )) as an approximation for the true posterior. One of the first application of VI in NNs was by Hinton & Van Camp (1993) but the optimization remained intractable for most Bayesian Neural Networks (BNNs). Graves (2011) revisited similar ideas and proposed a simple but biased estimator for performing VI with a fully factorized posterior (mean field assumption).

Recently, Bayes-by-Backprop algorithm (BBB) also employed VI using an unbiased estimator for Variational loss, a fully factorized Gaussian posterior and a non-Gaussian prior Blundell et al. (2015) . Interestingly, Gal & Ghahramani (2016) showed links between Bernoulli Dropout (Srivastava et al. (2014) , Hinton et al. (2012) ) and approximate inference in Deep Gaussian Process (Damianou & Lawrence (2013) ), thus allowing for the extraction of uncertainty estimates of a NN in a principled way. Louizos & Welling (2016) arrived at the same conclusion through structured posterior approximations via matrix variate Gaussian Posterior (Gupta & Nagar (2018) ) and local reparameterization trick (Kingma et al. (2015) ).

Bayesian methods are far more computationally expensive, as compared to standard NNs, making Deep Ensembles a very attractive alternative as they scale well to large datasets and models. The intuition behind Deep Ensembles is straightforward, NNs initialized and trained independently can be expected to output similar predictions on training data, while disagreeing on points away from training set. Despite their empirical success in uncertainty estimation and adversarial robustness (Lakshminarayanan et al. (2017) , Strauss et al. (2018) ), Deep Ensembles have lacked theoretic support from the Bayesian perspective. Thus, it is interesting to see how ensembles of deterministic and stochastic NNs can be placed into the VI framework. Another drawback of Deep Ensembles is their heavy parametric overhead. We modify the BBB algorithm to learn mixture distributions rather than the unimodal Gaussian distribution, which reduces this burden. We further show that this way, Deep Ensembles can be linked with the Bayesian framework. In essence, using our methods, we are able to achieve accuracy and uncertainty estimates (with lower parametric cost) which are never worse than Deep Ensembles, BBB, Concrete Dropout Contributions: We design an efficient and simple way of sampling from mixture distributions which incorporates the "local reparameterization trick" (Kingma et al. (2015) ) to obtain low variance gradients for tuning of parameters in mixture distributions. This is also of independent interest for designing more complex posteriors using any mixture distributions besides the ones used in this paper. We also fit ensembles of deterministic and Bayesian NNs into VI framework with no changes made to the original algorithm. We improve upon the uncertainty estimates of Deep Ensembles by using mixture distribution with relatively less number of parameters.

Distribution of the paper -In section 2, we show how the original BBB algorithm can be modified for generalized mixture distributions while remaining back-prop compatible. For simplicity, we stick to a mixture of Gaussian's. In section 3, we provide links between Ensembles and VI with mixture distributions. Section 4 contains experiments that demonstrate that our methods generate superior uncertainty estimates as compared to unimodal distributions or Deep Ensembles.

2. CONCRETE MIXTURE OF GAUSSIAN:

A feed-forward network trained with gradient descent will arrive at point estimates. However, in the case of BNNs, the weights are not point estimates but a probability distribution. Let us revisit the problem of finding a functional relationship y = f W (x) between input x and output y, given a labelled training dataset D = {(x 1 , y 1 ), (x 2 , y 2 ), . . . } from a Bayesian standpoint. Our task is to find a distribution over the parameters p(W |D), given the input data. Given this posterior, we can predict test output y * given a new test input x * by marginalizing the likelihood over the space of parameters W . However, even for modest sized NNs, the number of uncertain parameters prohibit this calculation analytically. We require approximate inference methods in such cases. We define an approximating variational distribution q θ (W ) with parameters θ. We would minimize the Kullback-Leibler (KL) Divergence with respect to the parameters θ to maximize the similarity between proposed posterior and the true posterior. Note that the problem of minimizing KL Divergence can be reformulated to minimizing of another term usually called the Variational free energy in literature Friston et al. (2007) , Blundell et al. (2015) . Evaluating the objective of maximizing this is computationally expensive for large datasets therefore. Thus we split the entire data into M mini batches D 1 , D 2 , . . . , D M . The unbiased Monte Carlo (MC) approximation to the minibatch cost it given as:

EQUATION

In order to use stochastic backpropogation, we need the MC sample W j to be reparameterized as g(θ, ). We shall see how this is possible for Mixture of Gaussians (MoG) next.

2.1 SAMPLING FROM CONCRETE MIXTURE OF GAUSSIAN Blundell et al. (2015) proposed the Bayes-by-Backprop algorithm for tuning of weight posterior's parameters. For simplicity, the posterior was assumed to be fully factorized Gaussian. The assumption of fully factorized posterior is also known as the Mean Field assumption in the literature. We show method to sample from for mixture of Gaussian (MoG) for independent weights and mixture of matrix variate Gaussian (MoMG) for correlated weights, while still being able to use the local reparameterization trick. This method can be extended for any mixture of distributions in general.

q θ (W ) = N i=1 N(w i ; µ i , σ 2 i ) θ = (µ i , σ 2 i ) (i=1

To sample weight w from a mixture of K Gaussians i.e. w ∼ q θ (w) = K j=1 p j N(w; µ j , σ 2 j ), K j=1 p j = 1, we assume a latent random variable which governs the component of the mixture that generates the value of w. We assume the latent random variable to be uniform random variable u i.e. u ∼ Uniform[0,1] . The latent random variable u has a p j probability of being in the range [p j-1 , p j + p j-1 ), similarly it has p j+1 probability of being in between [p j + p j-1 , p j + p j-1 + p j+1 ) and so on, thus if u falls in the range [p j-1 , p j + p j-1 ) we sample from the j'th distribution N(w; µ j , σ 2 j ). For example when sampling from mixture of three Gaussian, we will have to first sample two random variables z p1 and z p1+p2 , which can be seen as correlated Bernoulli random variables.

u ∼ Uniform[0, 1], z p1 = 1 u<p1 , z p1+p2 = 1 u<p1+p2 and ∼ N(0, 1) w = z p1 (µ 1 + σ 1 ) + (1 -z p1 )(z p1+p2 )(µ 2 + σ 2 ) + (1 -z p1+p2 )(µ 3 + σ 3 ) (3)

Unfortunately, in the above case where we sample w from a multimodal distribution, local reparametrization trick cannot be applied. This is because the Bernoulli random variables z p1 and z p1+p2 can't be parameterized in the form of g(θ, ). So, we replace them with their continuous relaxation, the Concrete distribution Gal et al. (2017 ),Maddison et al. (2016) . This distribution can be viewed as softmax relaxation of the max function used in Gumbel-max trick Gal et al. (2017) . This allows us to represent the discrete random variable z p1 as ẑp1 = g(θ, ). Thus we replace z p1 and z p1+p2 in equation 4 with:

z p1 ≈ ẑp1 = sigmoid( 1 t .(log(p 1 ) -log(1 -p 1 ) + log(u) -log(1 -u)) z p1+p2 ≈ ẑp1+p2 = sigmoid( 1 t .(log(p 1 + p 2 ) -log(1 -p 1 -p 2 ) + log(u) -log(1 -u)) (4)

where, t is the temperature term and is usually kept as 0.1 or 0.01 (<<1 to guarantee most of the mass of the pdf is around 0 and 1). So, we have now successfully reparameterized w as g(θ, ) where θ = (µ 1 ,σ 1 ,µ 2 ,σ 2 ,µ 3 ,σ 3 ,p 1 ,p 2 ). To prevent parametric explosion, we assume p 1 , p 2 are same for the entire layer. This is similar to assuming that Dropout parameter p is the same for entire layer. Thus now, with mean field assumption we can now define the posterior of the weight matrix W from mixture of K Gaussians as:

EQUATION

To model the correlations among the weights it is possible for us the treat the entire weight matrix W of a layer, as a MoMG Gupta & Nagar (2018) i.e. p(W

) = i p i MN(M i , U i , V i ), where p(W ) = MN(M i , U i , V i ) = exp(-1 2 tr[V -1 i (W -M i ) T U -1 i (W -M i )]) (2π) rc/2 |V i | c/2 |U i | r/2 (6)

M i is a r × c matrix and is the mean of the distribution, U i is a r × r matrix that provides covariance of the rows and V i is a c × c matrix that governs the covariance of the columns of the matrix. It has been shown by Gupta et al. in Gupta & Nagar (2018) that matrix variate distributions are essentially multivariate Gaussian.

p(vec(W )) = N(vec(M i ), V i ⊗ U i ), ⊗ is the Kronecker product (7)

Thus, now instead of treating each weight independently we are now able to sample directly from its joint distribution which is assumed to be a MoMG. For sampling from a mixture of 2 matrix variate

Gaussian, W = z p (M 1 + U 1 2 1 EV 1 2 1 ) + (1 -z p )(M 2 + U 1 2 2 EV 1 2

2 ))where E i,j ∼ N(0, 1). We replace z p with its continuous relaxed version ẑp , thus making it possible to use the local reparameterization trick. We assume U i = diag(σ 2 ri ) and V i = diag(σ 2 ci ) i.e. independent rows and columns in this paper. This allows us to reduce the number of parameters as compared to MoG, while still modelling correlations between weights. Now that we are able to sample from MoG and MoMG we need to be able to approximate D KL (q θ (W )||p(W )), where we assume a Gaussian prior i.e. p(W ) = N(0, l -2 I). We use Monte Carlo approximations similar to the one used in Blundell et al. (2015) for optimising the D KL (q θ (W )||p(W )).

For all following sections, we interchangeably use the name Concrete MoG (CMoG) and Concrete MoMG (CMoMG) for MoG and MoMG respectively.

3. DEEP ENSEMBLE AS BAYESIAN INFERENCE:

Deep Ensemble is a simple non-Bayesian framework which is able to predict uncertainty on out-ofdistribution samples. Deep Ensemble algorithm involves training M randomly initialized networks on independently sampled batches. Owing to its simplicity and scalability, Deep Ensemble is widely used for uncertainty estimation. This departure from Bayesian methodology to capture uncertainty is of concern since the Bayesian framework is a principled and widely accepted approach to capture uncertainty. Thus, it is indeed surprising to see that with no simplification made to the original Deep Ensemble algorithm described in Lakshminarayanan et al. ( 2017), we can show equivalence with the VI framework. In order to show the equivalence with VI, we assume the approximate posterior is a mixture of points or Gaussian (with σ → 0) in a high dimensional probability space. For example in case the network has only two layers with parameters W 1 and W 2 respectively, the joint distribution is

q(W 1 , W 2 |θ) = pN(M 1 , σ 2 I) + (1 -p)N(M 2 , σ 2 I)(σ → 0)

, where θ is the set of all variational parameters which in this case are M 1 and M 2 . We fix probability p = 1 2 . Note, M 1 = [M 11 , M 12 ] is the concatenation of the variational parameters of layer 1 and layer 2, and similarly, M 2 = [M 21 , M 22 ] is the concatenation of the variational parameters of layer 1 and layer 2 (Assuming we have a NN of only two layers for simplicity). For example if the first point is selected while sampling, we will have W 1 = M 11 and W 2 = M 12 , we will see that minimizing the KL divergence of this posterior with the true posterior is mathematically equivalent to the Deep Ensemble algorithm described above. For sampling, the W 1 and W 2 from the above posterior, we use the same sampling technique as described for MoG, except that here same random variable z p is tied to all variational parameters.

EQUATION

In MoG for every weight we had to sample a separate z p independently for each weight. This random variable tying is the only difference in sampling between the two, and this observation is a critical tool linking Deep Ensemble to VI Framework. Next we try to minimize the unbiased Monte Carlo (MC) estimate of the mini-batch variational free energy. Minimizing the mini-batch cost for mini-batch i = 1, 2 . . . M

w (i) ∼ q θ (w), L i V I-M C = -log(p(D (i) |w (i) )) + 1 M log(q(w (i) |θ)) - 1 M log(p(w (i) )) (9)

Note we have taken a MC estimate of the KL divergence too, but following Hoffman et al.

(2013),Kingma & Welling (2014) convergence to the same limit as the expectation of variational free energy is still guaranteed. Now assume a Gaussian prior i.e. P (w (i) ) = N(0, l -2 I). Note for p = 1 2 there are equal chance of having w (i) = M 1 or w (i) = M 2 , suppose for this batch i,

w (i) = M 1 L i V I-M C = -log(p(D (i) |M 1 )) + 1 M log( 1 2 ) + 1 M 1 2 l 2 ||M 1 || 2 2 (10)

We further simplify loss function for regression case, and fit a Gaussian with variance τ -1 (also called model precision), to the negative log-likelihood of the data i.e. p(y j |x j , M 1 ) = N(y j ; ŷj , τ -1 I). So, after dividing the whole equation by τ we have

L i V I-M C ∝ 1 2 j∈D i ||y j -ŷj || 2 2 + 1 M τ log( 1 2 ) + 1 M 1 2τ l 2 ||M 1 || 2 2 (11)

Minimizing the above equation can be seen as training a single NN with parameters M 1 on mini batch i with L2 regularization λ = 1 2M τ l 2 . Equivalently, there will be another mini-batch j where w (j) = M 2 , and minimizing the MC estimate of the variational free energy, in this case, will be equivalent to training a NN with parameters M 2 with the same regularization as before. This is equivalent to a Deep Ensemble of 2 NNs with parameters M 1 and M 2 which were randomly initialized and trained on independently sampled mini-batches as was in the original algorithm. The predictive distribution of unknown label y * is given as q(y * |x * ) = p(y * |x * , w)q(W |θ)dW = 1 2 p(y * |x * , M 1 ) + 1 2 p(y * |x * , M 2 ), which is a mixture of Gaussian and matches the predictive distribution of Deep Ensemble. Thus independently training an Ensemble of NN's can be seen as training a "hypothetical" Bayesian NN's with a specific mixture distribution.

Although we have shown equivalence for a specific case of 2 NNs, it can be easily generalized to N NNs, by considering an approximate posterior a mixture of N points and taking p = 1 N . Note that we can tune p's too by using the same concrete relaxation that we took in CMoG. We called this modified algorithm Concrete Ensemble.

Stein Variational Gradient Descent (SVGD) (Liu & Wang (2016) ) is particle based Bayesian approach and is close to Deep Ensembles. Both SVGD and Deep Ensembles can be viewed as particle filters trying to approximate an underlying distribution. The mini-batch SVGD update is given as

θ t+1 i = θ t i + 1 N N j=1 [k(θ t j , θ t i )∇ θ t j log(p(θ t j |D i )) + ∇ θ t j k(θ t j , θ t i )].

Ensembles have a mode seeking nature, whereas SVGD seek to maintain some level of diversity. SVGD is far less popular despite their similarity with Deep Ensembles because in practice, different initializations for large scale NNs suffice for capturing different modes, and thus, the additional time complexity overhead of O(N 2 ) for computing the kernel is not justified by empirical results.

More specifically, if f θ (w) = 1 N N i=1 f i (w; θ i ), where θ i are independent variational parameters, and f i (w) could be any arbitrary distribution. Let us define L(θ) as the Variational Free Energy of the mixture distribution f θ (w), and L(θ i ) as the Variational Free Energy of the individual mixture component f i (w; θ i ). We can approximately bound L(θ) as;

1 N N i=1 L(θ i ) -H( 1 N ) ≤ L(θ) ≤ 1 N N i=1 L(θ i )

, where H(p ) is the entropy. So, individually optimizing θ i 's (since they are independent of each other) is also minimizing the variational free energy of the mixture distribution, and interestingly increasing the ensemble size increases the tightness of the bound.The upper bound is arrived at using the convexity of KL divergence and the lower bound is obtained by further lower bounding the variational approximation to KL divergence between mixture distributions (Durrieu et al. (2012) ). See Appendix A.2 for more details Simple arguments that will allow us to extend this proof to ensemble of arbitrary architecture of Neural Networks have been added to Appendix 3.

4. EXPERIMENTS:

The following networks are used in experiments: Normal feed forward Multi Layer Perceptron (MLP), Deep Ensemble of 3 NN (Ensemble)(Lakshminarayanan et al. ( 2017)), Concrete Deep Ensemble of 3 NN (CEnsemble), Concrete Mixture of 3 Gaussain (CMoG) with p's tied for each layer (3 p's per layer), Concrete Mixture of 2 Matrix Variate Gaussian (CMoMG), Bayes by Backprop (BBB) (Blundell et al. (2015) ) and Concrete Dropout (CDropout) (Gal et al. (2017) ).

4.1. REGRESSION TASK:

We use Concrete mixture of Gaussian, and Concrete Ensemble described above to fit y = x 3 for -4 < x < 4, and observe the estimation for -6 < x < 6. We observe our algorithms (CMoG and CMoMG) can predict uncertainty in out of training data points much better compared to the uncertainty estimation with vanilla NN or previous uncertainty estimation frameworks like MC-Dropouts Gal (2016) , Ensemble, BBB, and Concrete dropouts. For both CMoG (we consider a mixture of 2 and 3 Gaussian) and Concrete Ensemble, we use fully connected feed forward NN with two hidden layers of size 100 each and ReLU activation, and performed a forward pass ten times, with result averaging for training, and for testing, performing a forward pass on trained NN forty times. We perform this experiment thrice and average the results. Figure 1 compares uncertainty estimation using CMoG and Concrete Ensemble with previous frameworks for the same architecture as described above. In this subsection, we show advantage of using multimodal posterior for fully connected feed forward networks. We first describe results for our methods on the classification task of MNIST digit dataset (LeCun et al. (2010) ). We use a fully connected network with two hidden layers having 1000 and 600 units respectively and ReLU activation. The last layer is a softmax layer with ten units. Refer appendix section for accuracy obtained and no. of parameters used. Now, we assess how our methods behave when test data does not lie on the training manifold. Overconfident predictions on such data are one of the most important challenges for reliable deployment of deep learning methods in the real world. The expectation is that if the input image does not lie on the training manifold, then the predictive uncertainty should be high. We use the same architecture as described above for the remaining subsection.

The first experiment we do is evaluate the predictive uncertainty of model trained on MNIST dataset on Fashion MNIST dataset (Xiao et al. (2017) ). This is similar to MNIST-NotMNIST experiment done by Lakshminarayanan et al. (2017) . As the images in Fashion MNIST dataset are completely different than in MNIST, ideally a trained model should be very uncertain about its prediction. Figure 3 shows the histogram of entropy of the output of trained models using different methods on test MNIST, and test Fashion MNIST data. MLP and Concrete Dropout are overconfident on predictions for Fashion MNIST data. Deep Ensemble and CEnsemble show an increase in no. of data points showing high entropy. BBB shows significant improvement over previously described methods. CMoMG shows comparable results with BBB even after having more modes indicating that the assumption of independent rows and columns may not be best for capturing uncertainty. CMoG gives the best results by far, which are also near ideal expectations. For second and third experiment we use more sophisticated methods for analyzing behavior of predictive uncertainty of model as done in Li & Gal (2017) . We don't include MLP and Concrete Dropout for these experiments for better clarity (they perform significantly worse). The second experiment considers single gradient step Fast Gradient Sign (FGS) method (Goodfellow et al. (2014) ). The method generates an adversarial input by adding small perturbations to an input image by moving in the direction which reduces predicted class probability. 

EQUATION

We fix η to 0.01 and iteratively update for 100 iterations. The results obtained are shown in Figure 5 . CMoMG has the slowest decaying and slowest rising true class and target class accuracy respectively making it more robust against targeted attack. CMoG has highest rise in predictive entropy, making it more suited for identifying adversarial attack. We note that for iteration 30-100, CMoMG has better ability to identify an adversarial input. Both these methods having multi-modal posterior perform better than BBB and Ensemble based methods.

More detailed analysis is required for examining the performance of our methods on adversarial attacks, but we conclude from the experiments that multi-modal posterior based methods are well suited for capturing uncertainty.

4.3. UNCERTAINTY ESTIMATION ON ALEXNET AND RESNET:

We implement multimodal posterior for AlexNet (Krizhevsky et al. (2012) ) and ResNet (He et al. (2016) )for getting better uncertainty estimates. The posterior used is only for fully connected layers before final layer thus, with less no. of parameters than Deep Ensemble. All the other layers except fully connected layer have been used with spatial concrete dropout. Refer appendix section for accuracy obtained and no. of parameters used.

We repeat the MNIST-FashionMNIST experiment done in subsection 4.2 for AlexNet. Figure 6 (L) shows the result obtained. We have shown CDF for better comparison. Note that, even with slightly less no. of parameters CMoG provides considerable improvement over Deep Ensembles while BBB This further proves that we can indeed get better uncertainty estimates for deep networks by using multimodal posterior on few layers with only a small increase in parameters over normal network.

4.4. CONTEXTUAL BANDIT:

We consider an online learning task (Mushroom Bandit Task Collier & Llorens (2018) , Blundell et al. (2015) ) to get a clear handle on the usefulness of uncertainty estimates. In an online setup, the agent plays her action based on a policy π. Based on this action, the environment reveals a stochastic reward. The objective of online learning is to Update the policy π as more and more data is revealed to maximize the cumulative reward received. Since the reward revealed is a noisy reward, online learning algorithms face a fundamental dilemma: exploration v/s exploitation. Typically, online learning algorithms explore in high uncertainty environments and exploit in low uncertainty setups.

We train a contextual neural bandit to learn the dependency between the context and optimal action as per the pseudo-algorithm given in Collier & Llorens (2018) . We train the NN based on BBB, CMoG, Ensemble, CEnsemble, and CMoMG. The regret variation is shown in figure 7 with the results have been averaged over three trials.

The MoG agent achieves a balance between eating and ignoring mushrooms more quickly than an ensemble network and incurs the least regret. Similarly, Matrix Variate based CMoMG can estimate uncertainty better than BBB and learns the context much faster. Thus, we can see that the ability to capture multiple modes provides us superior estimates of uncertainty, allowing us to balance exploration-exploitation in a better way. Variational free energy has two components the Expected loss and the KL divergence between the assumed posterior and the prior. Now because the Expectation over a mixture distribution is equal to the sum over expectation of individual components all we need to do is bound the KL divergence between mixture distribution and true posterior in terms of KL divergence between individual mixture components and the true posterior.

Thus we want to bound the KL divergence between f(x) and g(x) where

f θ (x) = N i=1 p i f i (x; θ i )

p i is the weight of the component individual i in the mixture distribution.

A simple upper bound can be achieved using convexity of KL distance as

EQUATION

Keeping p i fixed as 1 N will give us the desired upper bound We can also find the lower bound using the Variational Approximation (Hershey & Olsen (2007) ) by first splitting the KL divergence into two components-

EQUATION

We can use Jensen's inequality to get the appropriate lower bound for the first term as- 

:



Figures and Tables:

Figure 1: Uncertainty estimates (±1 std ) for out of distribution samples on toy regression data

Figure 3: MNIST-FashionMNIST : Histogram (200 bins) of entropy obtained on MNIST and Fashion MNIST test data

Figure 5: Targeted Attack: Classification accuracy for target class '0' and true class and predictive entropy vs. iterations. The adversarial images are shown(top to bottom) for BBB, CEnsemble, Ensemble, CMoG, and CMoMG

Figure 6: Predictive Entropy CDF: AlexNet on FashionMNIST (L), ResNet on SVHN (R) We repeat the same experiment but now for CIFAR-10 (Krizhevsky et al.) -SVHN (Netzer et al. (2011)), using ResNet-20. Figure 6(R) shows the uncertainty obtained on SVHN dataset after training the model on CIFAR-10 dataset. A clear improvement on uncertainty estimation can be observed for CMoG over Deep Ensembles with significantly less no. of parameters. This further proves that we can indeed get better uncertainty estimates for deep networks by using multimodal posterior on few layers with only a small increase in parameters over normal network.

Figure 7: Cumulative Regret Variation for Mushroom Bandit Task

x) log(p j f j (x)/φ ji )Maximizing the lower bound wrt φ ji under the constraint φ ji ≥ 0 and j φ ji = 1, ∀ i,j we getE f (log(f (x))Subtracting the two gives us the Variational Approximation(Hershey & Olsen (2007)) to KL divergenceD var (f ||g) = N i=1 p i D KL (f i ||g) + N i=1 p i log( N j=1p j e -D KL (fi||fj ) )Durrieu et al. (2012) empirically showed this approximation to be closer to D KL (f ||g) than most other approximations, thus D var (f ||g) ≈ D KL (f ||g)

reports the test accuracy obtained on MNIST with Fully connected network and results were averaged over three trials. The accuracy of CMoG , CEnsemble and CMoMG are better or comparable to benchmark MLP, BBB, Deep Ensemble and Concrete Dropout with the same architecture.Table3reports the test accuracy obtained on CIFAR-10 with Resnet-20 and results were averaged over three trials.

Table content: <table><tr><td/><td colspan="2">Table 1: Test Accuracy on MNIST</td></tr><tr><td>Method</td><td colspan="2">Test Accuracy No. of parameters (in Millions)</td></tr><tr><td>MLP</td><td>98.28</td><td>1.39</td></tr><tr><td>Concrete Dropout</td><td>98.8</td><td>1.39</td></tr><tr><td>Deep Ensemble</td><td>98.51</td><td>4.17</td></tr><tr><td>BBB</td><td>98.44</td><td>2.78</td></tr><tr><td colspan="2">Concrete Ensemble 98.57</td><td>4.17</td></tr><tr><td>CMoG</td><td>98.6</td><td>8.34</td></tr><tr><td>CMoMG</td><td>98.66</td><td>2.79</td></tr><tr><td colspan="3">Table 2 reports the test accuracy obtained on MNIST with AlexNet and results were averaged over</td></tr><tr><td>three trials.</td><td/><td/></tr><tr><td/><td colspan="2">Table 2: Test Accuracy on MNIST</td></tr><tr><td colspan="3">Method (Dataset) Test Accuracy No. of parameters (in Thousands)</td></tr><tr><td>CMoG</td><td>99.36</td><td>44.94</td></tr><tr><td>BBB</td><td>99.26</td><td>21.58</td></tr><tr><td>Deep Ensemble</td><td>99.29</td><td>48.25</td></tr><tr><td>CMoMG</td><td>99.18</td><td>29.38</td></tr></table>

Test Accuracy on CIFAR-10 Table 4 reports the Expected Calibration Error (ECE) on CIFAR-10 with Resnet-20 and results were averaged over three trials.

Table content: <table><tr><td colspan="3">Method (Dataset) Test Accuracy No. of parameters (in Millions)</td></tr><tr><td>CMoG</td><td>91.9</td><td>0.273</td></tr><tr><td>BBB</td><td>91.01</td><td>0.271</td></tr><tr><td>Deep Ensemble</td><td>92.1</td><td>0.81</td></tr><tr><td/><td colspan="2">Table 4: ECE on CIFAR-10</td></tr><tr><td/><td>Method</td><td>ECE</td></tr><tr><td/><td>CMoG</td><td>0.019</td></tr><tr><td/><td colspan="2">MoG (categorical p) 0.023</td></tr><tr><td/><td>Deep Ensemble</td><td>0.018</td></tr></table>

Peer review (iclr2020):
Summary: This paper proposes to use either relaxed mixture distributions or relaxed mixtures of matrix Gaussians as the approximate posterior for Bayesian neural networks. Naturally, taking the mixture variance to zero allows a stretched interpretation of ensembling to become Bayesian as well. Experiments are performed on small neural networks on regression tasks, as well as uncertainty estimation experiments on deep networks. Finally, a downstream task of bandit optimization (the mushroom experiment) is performed. post-rebuttal: I*d like to sincerely thank the authors of the paper for their enlightening discussions about their work. I*m inclined to think that this paper has a future, and definitely encourage the authors to resubmit - taking into account the reviews here. In particular, it would be greatly helpful if they cleaned up some of the writing and explanation, as our discussion points to. However, my stance on the codebase remains mostly unchanged - while a notebook ended up being released with their method, it was too close to the deadline and in a bit too rough of shape to really be able to poke through their implementation. From a quick pass, their implementation seems to be correct - although rather than attempting to base their code on the old torch/lua implemenations, I*d still suggest using a pre-written version. However, without the completely trained numbers, I cannot in good conscience vote to accept the paper. Tldr: I vote to reject this paper for several reasons. The interpretation of ensembling as variational inference is both flawed and well known. Mixture distributions have been previously proposed for variational inference. There are significant enough weaknesses in the empirical results that make me question the authors’ own implementations. I will increase my score if these issues are resolved. Originality: 1) It is well known (and immediately obvious) that one can interpret ensembles as a Bayesian method – with a mixture of delta functions around the independently trained models. Furthermore, the Bayesian bootstrap (Rubin, 1983) is a Bayesian interpretation of the bootstrap (identical under many conditions), while re-weighted ensembles are Bayesian models (Newton, 1995; Newton, 2018) that converge to the true posterior under many conditions – intriguingly, this version of re-weighting could potentially have good uncertainty quantification properties. For the specific case of stacking (which is closely related to ensembling), there are interpretations of stacking as Bayesian model combination (Yao et al, 2018, Clyde & Iversen, 2013). As a result, this view of ensembling as a Bayesian method is not novel. 2) Additionally, the derivation of dropout as Bayesian inference (which relies on a similar interpretation on taking the variance parameter in the Gaussian to zero) is known to be flawed (Hron et al, 2018); this flaw is directly applicable to the interpretation of ensembling as variational inference as described in Section 3 of this paper. The issue is fundamental: when taking the variance parameter to zero, the supports of the variational distribution and the true distributions have a mismatch, causing the KL divergence to become infinite. As a result, one cannot minimize the objective (as it is infinite by design). Clarity: 1) The proposed methods are clearly explained in the setting under which one might be able to re-implement them, particularly in the description of the approximate posteriors. post rebuttal: to my knowledge, this was never really addressed. In particular, *why do we want to interpet ensembling in a Bayesian manner?* is still an open question to me. 2) Why is that we should expect (approximate) Bayesian procedures to be better calibrated than frequentist ones? It may be the case that if the integrals are accurately estimated (e.g. we have reached the true posterior and the model used for the data is in fact accurate), then we should expect Bayesian procedures to be well calibrated. However, this does not seem to be the case. A reference or argument for why (even in the model incorrect & approximate inference cases) in the introduction would greatly enhance the strength of the paper. post rebuttal: I think that this issue was addressed in a reasonable manner through the rebuttal, but will require a bit of rewriting. 3) From a quick pass through Appendix A.2, the derivation is quite unstructured and difficult to follow. It is tough to see exactly what is being meant by the probabilities in the first line. Additionally, the phrasing of “We further lower bound…” seems to suggest that the bound being used is not the well known bound of Durrieu et al, 2012, but a looser bound. If so, what is the approximation accuracy of this bound in relation to the other bounds compared against in this setting? 4) In sum, three different methods are proposed: concrete mixtures of Gaussians, concrete ensembles, and concrete mixtures of matrix variate Gaussians. Throughout the experiments, it seems like __one__ of these methods always wins on the task at hand. However, it does not always seem to be the same method. Is there a recommendation for practitioners as to which method to use – or is this simply task dependent? Specifically, is there an understanding as to why each method performs vastly differently on each task? A priori, I would expect the concrete mixture of matrix variate Gaussians to always perform best because it does seem to be able to model multivariate posteriors the best. However, it seems to perform worse on several of the predictive uncertainty tasks. 5) For the uncertainty experiments, it would be nice to have more qualitative numbers – for example the expected calibration error – rather than just the plots on in and out of distribution example. After all, not only do we want to be able to recognize out of distribution examples, but we want to be able to trust the probabilities that are output. 6) In Figure 4, thank you for providing the adversarial attacks used to fool the networks – the step size parameter doesn’t give a great intuition, and the images are welcome and useful. Significance: post rebuttal: I think that this issue was satisfactorily addressed. 1) Mixture distributions as the variational family have already been proposed – at least once – see Miller et al, 2017 for an example that additionally uses the reparameterization trick. There, updates to the posterior are performed via selectively adding mixture components when necessary. Given that they also run experiments on neural networks, it would be nice to see a comparison to that method. Quality: 1) I am very concerned by the performance of the ResNet20 models trained on CIFAR10 in the paper. The reported results for deep ensembles (an ensemble of _three_ independently trained models) in Appendix A are 85.23% accuracy. By comparison, the number in the original paper (He et al, 2015) is 91.25% for a _single_ model. Furthermore, the first link to a PyTorch repo from a Google search (https://github.com/akamaster/pytorch_resnet_cifar10) comes up with a re-implementation that gets 91.63% (again for a single model). __This issue alone is enough for me to vote to reject the paper until the authors’ implementations are fixed and run with deep ensembled ResNets that get similar accuracy. I hope to see the implementation issues fixed in the rebuttal period. __ 2) Furthermore, in Appendix 2, I see a potential issue in using the KL divergence and would like the authors to clarify. If the secondary lower bound is being used to approximate the KL divergence between the mixture distributions, it becomes very unclear if what is being optimized is in fact a __lower bound__ on the log probability. After all, the standard ELBO is written as: Log p(y) geq ELBO := E_q(log p(y | 	heta)) – KL(q(	heta) || p(	heta)) Implying that another lower bound on the KL would be greater than the ELBO and thus not necessarily a lower bound on the log marginal likelihood. 3) Bottom of page 7: “The posterior is used only for fully connected layers…” Why is this the case? Alternative Bayesian methods can be used on the full network. Minor Comments: - Please attempt to use the math_commands.tex in the ICLR style file to write math. This makes the math standardized throughout. - Figure 1 is especially unclear and the legends and captions should be made considerably larger. Zooming in at 800% seems to be necessary to even be able to make out which method is which. Consider, placing all methods on a single plot and then coloring/dashing them separately. Additionally, please compare to HMC on this task (and an equivalent RBF GP) to show the uncertainties from the “gold standard” methods. - Please additionally make the figure legends larger for the rest of the figures. - What is the meaning of time in Figure 2? I assume that it means training time, but it is not especially clear from the caption. With that being said, I think that it is quite interesting that the marginals do seem to look multi-modal, even at the end of training. - Line before Eq 7: please use citet if possible to cite Gupta & Nagar, rather than stating the clunky Gupta et al. citep{Gupta & Nagar}. - Eq 2: please do not use hspace{-…} to save space in equations, so that the equation does not overwrite lines before. - Page 2: “Deep Ensembles have lacked theoretical support …” In order to make this claim, you must first explain why one ought to be Bayesian in the first place. See above for the history of interpreting ensembling from a Bayesian perspective. There is no a priori reason why one would not just wish to have frequentist justifications of ensembling (and potentially even calibration). - Please do not capitalize Ensembling or Variational Inference throughout. References: Clyde & Iversen, Bayesian model averaging in the M-open framework. In Bayesian Theory and Applications, 2013. DOI:10.1093/acprof:oso/9780199695607.003.0024 He, Zhang, Ren & Sun, Deep Residual Learning for Image Recognition, CVPR, 2016. https://arxiv.org/abs/1512.03385 Hron, Matthews & Ghahramani, Variational Bayesian dropout: pitfalls and fixes, ICML, 2018. https://arxiv.org/abs/1807.01969 Miller, Foti & Adams, Variational Boosting: Iteratively Refining Posterior Approximations, ICML, 2017. https://arxiv.org/abs/1611.06585 Newton & Raftery, Approximate Bayesian Inference with the Weighted Likelihood Bootstrap. JRSS:B, 1994. https://www.jstor.org/stable/2346025?seq=1#metadata_info_tab_contents Newton, Polson & Xu, Weighted Bayesian Bootstrap for Scalable Bayes, 2018; https://arxiv.org/abs/1803.04559 Rubin, The Bayesian Bootstrap, 1981. Annals of Statistics. https://projecteuclid.org/euclid.aos/1176345338 Yao, Vehtari, Simpson, & Gelman, Using Stacking to Average Bayesian Predictive Distributions, Bayesian Analysis, 2018; https://projecteuclid.org/euclid.ba/1516093227