THE DEEP WEIGHT PRIOR
Year: 2019

Abstract:
Bayesian inference is known to provide a general framework for incorporating prior knowledge or specific properties into machine learning models via carefully choosing a prior distribution. In this work, we propose a new type of prior distributions for convolutional neural networks, deep weight prior (dwp), that exploit generative models to encourage a specific structure of trained convolutional filters e.g., spatial correlations. We define dwp in a form of an implicit distribution and propose a method for variational inference with such type of implicit priors. In experiments, we show that dwp improves the performance of Bayesian neural networks when training data are limited, and initialization of weights with samples from dwp accelerates training of conventional convolutional neural networks.

heading: 1 INTRODUCTION
text: Bayesian inference is a tool that, after observing training data, allows to transforms a prior distribution over parameters of a machine learning model to a posterior distribution. Recently, stochastic variational inference (Hoffman et al., 2013) – a method for approximate Bayesian inference – has been successfully adopted to obtain a variational approximation of a posterior distribution over weights of a deep neural network (Kingma et al., 2015). Currently, there are two major directions for the development of Bayesian deep learning. The first direction can be summarized as the improvement of approximate inference with richer variational approximations and tighter variational bounds (Dikmen et al., 2015). The second direction is the design of probabilistic models, in particular, prior distributions, that widen the scope of applicability of the Bayesian approach.
Prior distributions play an important role for sparsification (Molchanov et al., 2017; Neklyudov et al., 2017), quantization (Ullrich et al., 2017) and compression (Louizos et al., 2017; Federici et al., 2017) of deep learning models. Although these prior distributions proved to be helpful, they are limited to fully-factorized structure. Thus, the often observed spatial structure of convolutional filters cannot be enforced with such priors. Convolutional neural networks are an example of the model family, where a correlation of the weights plays an important role, thus it may benefit from more flexible prior distributions.
Convolutional neural networks are known to learn similar convolutional kernels on different datasets from similar domains (Sharif Razavian et al., 2014; Yosinski et al., 2014). Based on this fact, within
∗Equal contribution
a specific data domain, we consider a distribution of convolution kernels of trained convolutional networks. In the rest of the paper, we refer to this distribution as the source kernel distribution. Our main assumption is that within a specific domain the source kernel distribution can be efficiently approximated with convolutional kernels of models that were trained on a small subset of problems from this domain. For example, given a specific architecture, we expect that kernels of a model trained on notMNIST dataset – a dataset of grayscale images – come from the same distribution as kernels of the model trained on MNIST dataset. In this work, we propose a method that estimates the source kernel distribution in an implicit form and allows us to perform variational inference with the specific type of implicit priors.
Our contributions can be summarized as follows:
1. We propose deep weight prior, a framework that approximates the source kernel distribution and incorporates prior knowledge about the structure of convolutional filters into the prior distribution. We also propose to use an implicit form of this prior (Section 3.1).
2. We develop a method for variational inference with the proposed type of implicit priors (Section 3.2).
3. In experiments (Section 4), we show that variational inference with deep weight prior significantly improves classification performance upon a number of popular prior distributions in the case of limited training data. We also find that initialization of conventional convolution networks with samples from a deep weight prior leads to faster convergence and better feature extraction without training i.e., using random weights.

heading: 2 DEEP BAYES
text: In Bayesian setting, after observing a dataset D = {x1, . . . , xN} of N points, the goal is to transform our prior knowledge p(ω) of the unobserved distribution parameters ω to the posterior distribution p(ω | D). However, computing the posterior distribution through Bayes rule p(ω | D) = p(D |ω)p(ω)/p(D) may involve computationally intractable integrals. This problem, nonetheless, can be solved approximately.
Variational Inference (Jordan et al., 1999) is one of such approximation methods. It reduces the inference to an optimization problem, where we optimize parameters θ of a variational approximation qθ(ω), so that KL-divergence between qθ(ω) and p(ω | D) is minimized. This divergence in practice is minimized by maximizing the variational lower bound L(θ) of the marginal log-likelihood of the data w.r.t parameters θ of the variational approximation qθ(W ).
L(θ) = LD −DKL(qθ(ω)‖p(ω))→ max θ
(1)
where LD = Eqθ(ω) log p(D |ω) (2)
The variational lower bound L(θ) consists of two terms: 1) the (conditional) expected log likelihood LD, and 2) the regularizerDKL(qθ(ω)‖p(ω)). Since log p(D) = L(θ)+DKL(qθ(ω)‖p(ω | D)) and p(D) does not depend on qθ(w) maximizing of L(θ) minimizes DKL(qθ(ω)‖p(ω | D)). However, in case of intractable expectations in equation 1 neither the variational lower bound L(θ) nor its gradients can be computed in a closed form.
Recently, Kingma & Welling (2013) and Rezende et al. (2014) proposed an efficient mini-batch based approach to stochastic variational inference, so-called stochastic gradient variational Bayes or doubly stochastic variational inference. The idea behind this framework is reparamtetrization, that represents samples from a parametric distribution qθ(ω) as a deterministic differentiable function ω = f(θ, ) of parameters θ and an (auxiliary) noise variable ∼ p( ). Using this trick we can efficiently compute an unbiased stochastic gradient ∇θL of the variational lower bound w.r.t the parameters of the variational approximation.
Bayesian Neural Networks. The stochastic gradient variational Bayes framework has been applied to approximate posterior distributions over parameters of deep neural networks (Kingma et al., 2015). We consider a discriminative problem, where dataset D consists of N object-label pairs D = {(xi, yi)}Ni=1. For this problem we maximize the variational lower bound L(θ) with respect to
parameters θ of a variational approximation qθ(W ):
L(θ) = N∑ i=1 Eqθ(W ) log p(yi |xi,W )−DKL(qθ(W )‖p(W ))→ max θ
(3)
where W denotes weights of a neural network, qθ(W ) is a variational distribution, that allows reparametrization (Kingma & Welling, 2013; Figurnov et al., 2018) and p(W ) is a prior distribution. In the simplest case qθ(W ) can be a fully-factorized normal distribution. However, more expressive variational approximations may lead to better quality of variational inference (Louizos & Welling, 2017; Yin & Zhou, 2018). Typically, Bayesian neural networks use fully-factorized normal or log-uniform priors (Kingma et al., 2015; Molchanov et al., 2017; Louizos & Welling, 2017).
Variational Auto-encoder. Stochastic gradient variational Bayes has also been applied for building generative models. The variational auto-encoder proposed by Kingma & Welling (2013) maximizes a variational lower bound L(θ, φ) on the marginal log-likelihood by amortized variational inference:
L(θ, φ) = N∑ i=1 Eqθ(zi | xi) log pφ(xi | zi)−DKL(qθ(zi |xi)‖p(zi))→ max θ,φ , (4)
where an inference model qθ(zi |xi) approximates the posterior distribution over local latent variables zi, reconstruction model pφ(xi | zi) transforms the distribution over latent variables to a conditional distribution in object space and a prior distribution over latent variables p(zi). The vanilla VAE defines qθ(z |x), pφ(x | z), p(z) as fully-factorized distributions, however, a number of richer variational approximations and prior distributions have been proposed (Rezende & Mohamed, 2015; Kingma et al., 2016; Tomczak & Welling, 2017). The approximation of the data distribution can then be defined as an intractable integral p(x) ≈ ∫ pφ(x | z)p(z) dz which we will refer to as an implicit distribution.

heading: 3 DEEP WEIGHT PRIOR
text: In this section, we introduce the deep weight prior – an expressive prior distribution that is based on generative models. This prior distribution allows us to encode and favor the structure of learned convolutional filters. We consider a neural network with L convolutional layers and denote parameters of l-th convolutional layer as wl ∈ RIl×Ol×Hl×Wl , where Il is the number of input channels, Ol is the number of output channels, Hl and Wl are spatial dimensions of kernels. Parameters of the neural network are denoted as W = (w1, . . . wL). A variational approximation qθ(W ) and a prior distribution p(W ) have the following factorization over layers, filters and channels:
qθ(W ) = L∏ l=1 Il∏ i=1 Ol∏ j=1 q(wlij | θlij) p(W ) = L∏ l=1 Il∏ i=1 Ol∏ j=1 pl(w l ij), (5)
where wlij ∈ RHl×Wl is a kernel of j-th channel in i-th filter of l-th convolutional layer. We also assume that qθ(W ) allows reparametrization. The prior distribution p(W ), in contrast to popular prior distributions, is not factorized over spatial dimensions of the filters Hl,Wl.
For a specific data domain and architecture, we define the source kernel distribution – the distribution of trained convolutional kernels of the l-th convolutional layer. The source kernel distribution favors learned kernels, and thus it is a very natural candidate to be the prior distribution pl(wlij) for convolutional kernels of the l-th layer. Unfortunately, we do not have access to its probability density function (p.d.f.), that is needed for most approximate inference methods e.g., variational inference. Therefore, we assume that the p.d.f. of the source kernel distribution can be approximated using kernels of models trained on external datasets from the same domain. For example, given a specific architecture, we expect that kernels of a model trained on CIFAR-100 dataset come from the same distribution as kernels of the model trained on CIFAR-10 dataset. In other words, the p.d.f. of the source kernel distribution can be approximated using a small subset of problems from a specific data domain. In the next subsection, we propose to approximate this intractable probability density function of the source kernel distribution using the framework of generative models.
Algorithm 1 Stochastic Variational Inference With Implicit Prior Distribution Require: dataset D = {(xi, yi)}Ni=1 Require: variational approximations q(w | θlij) and reverse models r(z |w;ψl) Require: reconstruction models p(w | z;φl), priors for auxiliary variables pl(z)
while not converged do M̂ ← mini-batch of objects form dataset D ŵlij ← sample weights from q(w|θlij) with reparametrization ẑlij ← sample auxiliary variables from r(z | ŵlij ;ψl) with reparametrization L̂aux ← LM̂+ ∑ l,i,j − log q(ŵlij | θlij)−log r(ẑlij | ŵlij ;ψl)+log pl(ẑlij)+log p(ŵlij | ẑlij ;φl)
Obtain unbiased estimate ĝ with E[ĝ] = ∇Laux by differentiating L̂aux Update parameters θ and ψ using gradient ĝ and a stochastic optimization algorithm
end while return Parameters θ, ψ

heading: 3.1 MODEL OF PRIOR DISTRIBUTION
text: In this section, we discuss explicit and implicit approximations p̂l(w) of the probability density function pl(w) of the source kernel distribution of l-th layer. We assume to have a trained convolutional neural network, and treat kernels from the l-th layer of this network wlij ∈ RHl×Wl as samples from the source kernel distribution of l-th layer pl(w).
Explicit models. A number of approximations allow us to evaluate probability density functions explicitly. Such families include but are not limited to Kernel Density Estimation (Silverman, 1986), Normalizing Flows (Rezende & Mohamed, 2015; Dinh et al., 2017) and PixelCNN (van den Oord et al., 2016). For these families, we can estimate the KL-divergence DKL(q(w | θlij)‖p̂l(w)) and its gradients without a systematic bias, and then use them for variational inference. Despite the fact that these methods provide flexible approximations, they usually demand high memory or computational cost (Louizos & Welling, 2017).
Implicit models. Implicit models, in contrast, can be more computationally efficient, however, they do not provide access to an explicit form of probability density function p̂l(w). We consider an approximation of the prior distribution pl(w) in the following implicit form:
p̂l(w) = ∫ p(w | z;φl)pl(z) dz, (6)
where a conditional distribution p(w | z;φl) is an explicit parametric distribution and pl(z) is an explicit prior distribution that does not depend on trainable parameters. Parameters of the conditional distribution p(w | z;φl) can be modeled by a differentiable function g(z;φl) e.g. neural network. Note, that while the conditional distribution p(w | z;φl) usually is a simple explicit distribution, e.g. fully-factorized Gaussian, the marginal distribution p̂l(w) is generally a more complex intractable distribution.
Parameters φl of the conditional distribution p(w | z;φl) can be fitted using the variational autoencoder framework. In contrast to the methods with explicit access to the probability density, variational auto-encoders combine low memory cost and fast sampling. However, we cannot obtain an unbiased estimate the logarithm of probability density function log p̂l(w) and therefore cannot build an unbiased estimator of the variational lower bound (equation 3). In order to overcome this limitation we propose a modification of variational inference for implicit prior distributions.

heading: 3.2 VARIATIONAL INFERENCE WITH IMPLICIT PRIOR DISTRIBUTION
text: Stochastic variational inference approximates a true posterior distribution by maximizing the variational lower bound L(θ) (equation 1), which includes the KL-divergence DKL(q(W )‖p(W )) between a variational approximation qθ(W ) and a prior distribution p(W ). In the case of simple prior and variational distributions (e.g. Gaussian), the KL-divergence can be computed in a closed form or unbiasedly estimated. Unfortunately, it does not hold anymore in case of an implicit prior distribution p̂(W ) = Πl,i,j p̂l(wlij). In that case, the KL-divergence cannot be estimated without bias.
To make the computation of the variational lower bound tractable, we introduce an auxiliary lower bound on the KL-divergence. KL-divergence:
DKL(q(W )‖p̂(W )) = ∑ l,i,j DKL(q(w l ij |θlij)‖p̂l(wlij)) ≤ ∑ l,i,j ( −H(q(wlij | θlij)) +
+Eq(wlij | θlij) [ DKL(r(z |wlij ;ψl)‖pl(z))− Er(z |wlij ;ψl) log p(w l ij | z;φl) ]) = DboundKL , (7)
where r(z |w;ψl) is an auxiliary inference model for the prior of l-th layer p̂l(w), The final auxiliary variational lower bound has the following form:
Laux(θ, ψ) = LD −DboundKL ≤ LD −DKL(qθ(W )‖p̂(W )) = L(θ) (8) The lower bound Laux is tight if and only if the KL-divergence between the auxiliary reverse model and the intractable posterior distribution over latent variables z given w is zero (Appendix A).
In the case when qθ(w), p(w | z;φl) and r(z |w;ψl) are explicit parametric distributions which can be reparametrized, we can perform an unbiased estimation of a gradient of the auxiliary variational lower boundLaux(θ, ψ) (equation 8) w.r.t. parameters θ of the variational approximation qθ(W ) and parameters ψ of the reverse models r(z |w;ψl). Then we can maximize the auxiliary lower bound w.r.t. parameters of the variational approximation and the reversed models Laux(θ, ψ) → maxθ,ψ. Note, that parameters φ of the prior distribution p̂(W ) are fixed during variational inference, in contrast to the Empirical Bayesian framework (MacKay, 1992).
Algorithm 1 describes stochastic variational inference with an implicit prior distribution. In the case when we can calculate an entropy H(q) or the divergence DKL(r(z |w;ψl)‖pl(z)) explicitly, the variance of the estimation of the gradient ∇L̂aux(θ, ψ) can be reduced. This algorithm can also be applied to an implicit prior that is defined in the form of Markov chain:
p̂(w) = ∫ dz0 . . . dzT p(w | zT )p(z0) T−1∏ t=0 p(zt+1 | zt), (9)
where p(zt+1 | zt) is a transition operator (Salimans et al., 2015), see Appendix A. We provide more details related to the form of p(w | z;φl), r(z |w;ψl) and pl(z) distributions in Section 4.

heading: 3.3 LEARNING DEEP WEIGHT PRIOR
text: In this subsection we explain how to train deep weight prior models for a particular problem. We present samples from learned prior distribution at Figure 1(c).
Source datasets of kernels. For kernels of a particular convolutional layer l, we train an individual prior distribution p̂l(w) = ∫ p(w | z;φl)pl(z) dz. First, we collect a source dataset of the kernels of the l-th layer of convolutional networks (source networks) trained on a dataset from a similar domain. Then, we train reconstruction models p(w | z;φl) on these collected source datasets for
each layer, using the framework of variational auto-encoder (Section 2). Finally, we use the reconstruction models to construct priors p̂l(w) as shown at Figure 1(a). In our experiments, we found that regularization is crucial for learning of source kernels. It helps to learn more structured and less noisy kernels. Thus, source models were learned with L2 regularization. We removed kernels of small norm as they have no influence upon predictions (Molchanov et al., 2017), but they make learning of the generative model more challenging.
Reconstruction and inference models for prior distribution. In our experiments, inference models r(z |w;ψl) are fully-factorized normal-distributions N (z |µψl(w), diag(σ2ψl(w))), where parameters µψl(w) and σψl(w) are modeled by a convolutional neural network. The convolutional part of the network is constructed from several convolutional layers that are alternated with ELU (Clevert et al., 2015) and max-pooling layers. Convolution layers are followed by a fully-connected layer with 2 · zldim output neurons, where zldim is a dimension of the latent representation z, and is specific for a particular layer.
Reconstruction models p(w | z;φl) are also modeled by a fully-factorized normal-distribution N (w |µφl(z), diag(σ2φl(z))) and network for µφl and σ2φl has the similar architecture as the inference model, but uses transposed convolutions. We use the same architectures for all prior models, but with slightly different hyperparameters, due to different sizes of kernels. We also use fullyfactorized standard Gaussian prior pl(zi) = N (zi | 0, 1) for latent variables zi. We provide a more detailed description at Appendix F.

heading: 4 EXPERIMENTS
text: We apply deep weight prior to variational inference, random feature extraction and initialization of convolutional neural networks. In our experiments we used MNIST (LeCun et al., 1998), NotMNIST (Bulatov, 2011), CIFAR-10 and CIFAR-100 (Krizhevsky & Hinton, 2009) datasets. Experiments were implemented1 using PyTorch (Paszke et al., 2017). For optimization we used Adam (Kingma & Ba, 2014) with default hyperparameters. We trained prior distributions on a number of source networks which were learned from different initial points on NotMNIST and CIFAR-100 datasets for MNIST and CIFAR-10 experiments respectively.

heading: 4.1 CLASSIFICATION
text: In this experiment, we performed variational inference over weights of a discriminative convolutional neural network (Section 3) with three different prior distributions for the weights of the convolutional layers: deep weight prior (dwp), standard normal and log-uniform (Kingma et al., 2015). We did not perform variational inference over the parameters of the fully connected layers. We used
1 The code is available at https://github.com/bayesgroup/deep-weight-prior
a fully-factorized variational approximation with additive parameterization proposed by Molchanov et al. (2017) and local reparametrization trick proposed by Kingma et al. (2015). Note, that our method can be combined with more complex variational approximations, in order to improve variational inference.
On MNIST dataset we used a neural network with two convolutional layers with 32, 128 filters of shape 7 × 7, 5 × 5 respectively, followed by one linear layer with 10 neurons. On the CIFAR dataset we used a neural network with four convolutional layers with 128, 256, 256 filters of shape 7 × 7, 5 × 5, 5 × 5 respectively, followed by two fully connected layers with 512 and 10 neurons. We used a max-pooling layer (Nagi et al., 2011) After the first convolutional layer. All layers were divided with leaky ReLU nonlinearities (Nair & Hinton, 2010).
At figure 2 we report accuracy for variational inference with different sizes of training datasets and prior distributions. Variational inference with deep weight prior leads to better mean test accuracy, in comparison to log-uniform and standard normal prior distributions. Note that the difference gets more significant as the training set gets smaller.

heading: 4.2 RANDOM FEATURE EXTRACTION
text: Convolutional neural networks produce useful features even if they are initialized randomly (Saxe et al., 2011; He et al., 2016; Ulyanov et al., 2017). In this experiment, we study an influence of different random initializations of convolutional layers – that is fixed during training – on the performance of convolutional networks of different size, where we train only fully-connected layers. We use three initializations for weights of convolutional layers: learned kernels, samples from deep weight prior, samples from Xavier distribution (Glorot & Bengio, 2010). We use the same architectures as in Section 4.1. We found that initializations with samples from deep weight prior and learned kernels significantly outperform the standard Xavier initialization when the size of the network is small. Initializations with samples form deep weight prior and learned filters perform similarly, but with deep weight prior we can avoid storing all learned kernels. At Figure 3, we show results on MNIST and CIFAR-10 for different network sizes, which are obtained by scaling the number of filters by k.

heading: 4.3 CONVERGENCE
text: Deep learning models are sensitive to initialization of model weights. In particular, it may influence the speed of convergence or even a local minimum a model converges to. In this experiment, we study the influence of initialization on the convergence speed of two settings: a variational auto-
encoder on MNIST, and convolutional networks on MNIST and CIFAR-10. We compare three different initializations of weights of conventional convolutional layers: learned filters, samples from deep weight prior and samples form Xavier distribution.
Figure 4 provides the results for a convolutional variational auto-encoder trained on MNIST and for a convolutional classification network trained on CIFAR-10 and MNIST. We found that deep weight prior and learned filters initializations perform similarly and lead to significantly faster convergence comparing to standard Xavier initialization. Deep weight prior initialization however does not require us to store a possibly large set of filters. Also, we plot samples from variational auto-encoders at a different training steps Appendix E.

heading: 5 RELATED WORK
text: The recent success of transfer learning (Yosinski et al., 2014) shows that convolutional networks produce similar convolutional filters while being trained on different datasets from the same domain e.g. photo-realistic images. In contrast to Bayesian techniques (Kingma et al., 2015; Kochurov et al., 2018), these methods do not allow to obtain a posterior distribution over parameters of the model, and in most cases, they require to store convolutional weights of pre-trained models and careful tuning of hyperparameters.
The Bayesian approach provides a framework that incorporates prior knowledge about weights of a machine learning model by choosing or leaning a prior distribution p(w). There is a huge amount of works on prior distributions for Bayesian inference (MacKay, 1992; Williams, 1995), where empirical Bayes – an approach that tunes parameters of the prior distribution on the training data – plays an important role (MacKay, 1992). These methods are widely used for regularization and sparsification of linear models (Bishop & Tipping, 2003), however, applied to deep neural networks (Kingma et al., 2015; Ullrich et al., 2017), they do not take into account the structure of the model weights, e.g. spatial correlations, which does matter in case of convolutional networks. Our approach allows to perform variational inference with an implicit prior distribution, that is based on previously observed convolutional kernels. In contrast to an empirical Bayes approach, parameters φ of a deep weight prior (equation 6) are adjusted before the variational inference and then remain fixed.
Prior to our work implicit models have been applied to variational inference. That type of models includes a number of flexible variational distributions e.g., semi-implicit (Yin & Zhou, 2018) and Markov chain (Salimans et al., 2015; Lamb et al., 2017) approximations. Implicit priors have been used for introducing invariance properties (Nalisnick & Smyth, 2018), improving uncertainty estimation (Ma et al., 2018) and learning meta-representations within an empirical Bayes approach (Karaletsos et al., 2018).
In this work, we propose to use an implicit prior distribution for stochastic variational inference (Kingma et al., 2015) and develop a method for variational inference with the specific type of implicit priors. The approach also can be generalized to prior distributions in the form of a Markov chain. We show how to use this framework to learn a flexible prior distribution over kernels of Bayesian convolutional neural networks.

heading: 6 DISCUSSION & CONCLUSION
text: In this work we propose deep weight prior – a framework for designing a prior distribution for convolutional neural networks, that exploits prior knowledge about the structure of learned convolutional filters. This framework opens a new direction for applications of Bayesian deep learning, in particular to transfer learning.
Factorization. The factorization of deep weight prior does not take into account inter-layer dependencies of the weights. Although a more complex factorization might be a better fit for CNNs. Accounting inter-layer dependencies may give us an opportunity to recover a distribution in the space of trained networks rather than in the space of trained kernels. However, estimating prior distributions of more complex factorization may require significantly more data and computational budget, thus the topic needs an additional investigation.
Inference. An alternative to variational inference with auxiliary variables (Salimans et al., 2015) is semi-implicit variational inference (Yin & Zhou, 2018). The method was developed only for semiimplicit variational approximations, and only the recent work on doubly semi-implicit variational inference generalized it for implicit prior distributions (Molchanov et al., 2018). These algorithms might provide a better way for variational inference with a deep weight prior, however, the topic needs further investigation.

heading: ACKNOWLEDGMENTS
text: We would like to thank Ekaterina Lobacheva, Dmitry Molchanov, Kirill Neklyudov and Ivan Sosnovik for valuable discussions and feedback on the earliest version of this paper. Andrei Atanov was supported by Samsung Research, Samsung Electronics. Kirill Struminsky was supported by Ministry of Education and Science of the Russian Federation (grant 14.756.31.0001).

heading: B THE ESTIMATE OF THE APPROXIMATION GAP WITH IWAE ESTIMATES
text: During variational inference with deep weight prior (Algorithm 1) we optimize a new auxiliary lower bound Laux(θ, ψ) on the evidence lower bound L(θ). However, the quality of such inference depends on the gap G(θ, ψ) between the original variational lower bound L(θ) and the variational lower bound in auxiliary space Laux(θ, ψ):
G(θ, ψ) = L(θ)− Laux(θ, ψ). (16) The gap G(θ, ψ) cannot be calculated exactly, but it can be estimated by using tighter but less computationally efficient lower bound. We follow Burda et al. (2015) and construct tighter lower bound LIWAEK (θ, ψ):
LIWAEK (θ, ψ) = LD +H(q(W ))+ (17)
+ ∑ l,i,j Eq(wlij |θlij)Ez1,...,zK∼q(z|wlijψl) log
( 1
K K∑ k=1 p(wlij |zk)pl(zk) q(zk|wlijψl)
) . (18)
The estimate LIWAEK (θ, ψ) converges to L(θ) with K goes to infinity (Burda et al., 2015). We estimate the gap with K = 10000 as follows:
G(θ, ψ) ≥ LIWAE10000 (θ, ψ)− Laux(θ, ψ). (19) The results are presented at the Table 1. In order to show the range of the estimate and the gain from learning of q(z|wlijψl) we compare results to the value of auxiliary lower bound Laux(θ, ψpl) computed at the point ψpl where q(z|wlijψpl) ≡ pl(z). The estimate of the gap, however, may be not very accurate and we consider it as a sanity check.

heading: C UNIVARIATE GAUSSIAN PRIOR
text: We examined a multivariate normal distribution p̂l(w) = N (w|µl,Σl). We used a closed-form maximum-likelihood estimation for parameters µl, Σl over source dataset of learned kernels for each layer. We conducted the same experiment as in Section 4.1 for MNIST dataset for this gaussian prior, the results presented at Fig. 5. We found that the gaussian prior performs marginally worse than deep weight prior, log-uniform and standard normal. The gaussian prior could find a bad local optima and fail to approximate potentially multimodal source distribution of learned kernels.
D VISUALIZATION OF DEEP WEIGHT PRIOR LATENT SPACE

heading: G NETWORK ARCHITECTURES

heading: F PRIOR ARCHITECTURES

heading: E SAMPLES FORM VARIATIONAL AUTO-ENCODERS

heading: H PYTORCH ARCHITECTURES
text: H.1 VAE PRIORS
• VAE model for 7x7 kernels (zdim = 2, 300 epochs, Adam optimizer with linear learning rate decay from 1e-3 to 0.):
VAE( (encoder): Encoder7x7( (features): Sequential( (0): Conv2d(1, 32, kernel_size=(3, 3), stride=(1, 1)) (1): ELU(alpha=1.0) (2): Conv2d(32, 64, kernel_size=(3, 3), stride=(1, 1)) (3): ELU(alpha=1.0) (4): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1)) (5): ELU(alpha=1.0))
(fc_mu): Conv2d(64, 2, kernel_size=(1, 1), stride=(1, 1)) (fc_var): Conv2d(64, 2, kernel_size=(1, 1), stride=(1, 1)))
(decoder): Decoder7x7( (decoder): Sequential( (0): ConvTranspose2d(2, 64, kernel_size=(3, 3), stride=(1, 1)) (1): ELU(alpha=1.0) (2): ConvTranspose2d(64, 64, kernel_size=(3, 3), stride=(1, 1)) (3): ELU(alpha=1.0) (4): ConvTranspose2d(64, 32, kernel_size=(3, 3), stride=(1, 1)) (5): ELU(alpha=1.0))
(fc_mu): Conv2d(32, 1, kernel_size=(1, 1), stride=(1, 1)) (fc_var): Conv2d(32, 1, kernel_size=(1, 1), stride=(1, 1))))
• VAE model for 5x5 kernels (zdim = 4, 300 epochs, Adam optimizer with linear learning rate decay from 1e-3 to 0.):
VAE( (encoder): Encoder5x5( (features): Sequential( (0): Conv2d(1, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) (1): ELU(alpha=1.0) (2): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) (3): ELU(alpha=1.0) (4): Conv2d(64, 128, kernel_size=(3, 3), stride=(1, 1)) (5): ELU(alpha=1.0) (6): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1)) (7): ELU(alpha=1.0))
(fc_mu): Conv2d(128, 4, kernel_size=(1, 1), stride=(1, 1)) (fc_sigma): Conv2d(128, 4, kernel_size=(1, 1), stride=(1, 1)))
(decoder): Decoder5x5( (activation): ELU(alpha=1.0) (decoder): Sequential( (0): Conv2d(4, 128, kernel_size=(1, 1), stride=(1, 1)) (1): ELU(alpha=1.0) (2): ConvTranspose2d(128, 128, kernel_size=(3, 3), stride=(1, 1)) (3): ELU(alpha=1.0) (4): ConvTranspose2d(128, 128, kernel_size=(3, 3), stride=(1, 1)) (5): ELU(alpha=1.0) (6): Conv2d(128, 64, kernel_size=(1, 1), stride=(1, 1)) (7): ELU(alpha=1.0))
(fc_mu): Sequential( (0): Conv2d(64, 1, kernel_size=(1, 1), stride=(1, 1))) (fc_var): Sequential( (0): Conv2d(64, 1, kernel_size=(1, 1), stride=(1, 1)) )))
H.2 NOTMNIST-MNIST
• Source models trained on notMNIST (l2=1e-3, 100 epochs, Adam optimizer with linear learning rate decay from 1e-3 to 0.) look as follows:
FConvMNIST( (features): Sequential( (conv1): Conv2d(1, 256, kernel_size=(7, 7), stride=(1, 1)) (relu1): LeakyReLU(negative_slope=0.01) (mp1): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False) (conv2): Conv2d(256, 512, kernel_size=(5, 5), stride=(1, 1)) (relu2): LeakyReLU(negative_slope=0.01) (mp2): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False) (flatten): Flatten())
(classifier): Linear(in_features=4608, out_features=10, bias=True))
• The final model (deterministic) trained on MNIST looks as follows (Adam optimizer with linear learning rate decay from 1e-3 to 0.):
FConvMNIST( (features): Sequential( (conv1): Conv2d(1, 32, kernel_size=(7, 7), stride=(1, 1)) (relu1): LeakyReLU(negative_slope=0.01) (mp1): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False) (conv2): Conv2d(32, 128, kernel_size=(5, 5), stride=(1, 1)) (relu2): LeakyReLU(negative_slope=0.01) (mp2): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False) (flatten): Flatten())
(classifier): Linear(in_features=1152, out_features=10, bias=True))
• The final model (bayesian) trained on MNIST looks as follows (Adam optimizer with linear learning rate decay from 1e-3 to 0.):
FConvMNIST( (features): Sequential( (conv1): BayesConv2d( (mean): Conv2d(1, 32, kernel_size=(7, 7), stride=(1, 1)) (var): LogScaleConv2d(1, 32, kernel_size=(7, 7), stride=(1, 1), bias=False))
(relu1): LeakyReLU(negative_slope=0.01) (mp1): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False) (conv2): BayesConv2d( (mean): Conv2d(32, 128, kernel_size=(5, 5), stride=(1, 1)) (var): LogScaleConv2d(32, 128, kernel_size=(5, 5), stride=(1, 1), bias=False)) (relu2): LeakyReLU(negative_slope=0.01) (mp2): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False) (flatten): Flatten())
(classifier): Linear(in_features=1152, out_features=10, bias=True))
H.3 CIFAR
• The source model for CIFAR looks as follows (l2=1e-4, 300 epochs, Adam, Linear learning rate decay from 1e-3 to 0.):
CIFARNet( (features): Sequential( (conv1): Conv2d(3, 128, kernel_size=(7, 7), stride=(1, 1)) (bn1): BatchNorm2d(128,
eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu1): LeakyReLU(negative_slope=0.01)
(maxpool): MaxPool2d( kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False) (conv2): Conv2d(128, 256, kernel_size=(5, 5), stride=(1, 1)) (bn2): BatchNorm2d(
256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu2): LeakyReLU(negative_slope=0.01) (conv3): Conv2d(256, 256, kernel_size=(5, 5), stride=(1, 1)) (bn3): BatchNorm2d(256,
eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu3): LeakyReLU(negative_slope=0.01) (conv4): Conv2d(256, 512, kernel_size=(5, 5), stride=(1, 1)) (bn4): BatchNorm2d(512,
eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu4): LeakyReLU(negative_slope=0.01) (flatten): Flatten())
(classifier): Sequential( (fc1): Linear(in_features=512, out_features=512, bias=True) (bn1): BatchNorm1d(512,
eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu1): LeakyReLU(negative_slope=0.01) (linear): Linear(in_features=512, out_features=100, bias=True)
))
• The final deterministic model (for CIFAR10) looks as follows: CIFARNetNew( (features): Sequential( (conv1): Conv2d(3, 128, kernel_size=(7, 7), stride=(1, 1)) (relu1): LeakyReLU(negative_slope=0.01) (maxpool): MaxPool2d(kernel_size=2, stride=2,
padding=0, dilation=1, ceil_mode=False) (conv2): Conv2d(128, 256, kernel_size=(5, 5), stride=(1, 1)) (relu2): LeakyReLU(negative_slope=0.01) (conv3): Conv2d(256, 256, kernel_size=(5, 5), stride=(1, 1)) (relu3): LeakyReLU(negative_slope=0.01) (flatten): Flatten())
(classifier): Sequential( (fc1): Linear(in_features=6400, out_features=512, bias=True) (relu1): LeakyReLU(negative_slope=0.01) (linear): Linear(in_features=512, out_features=10, bias=True)
))
• The final Bayesian model (for CIFAR10) looks as follows: CIFARNetNew( (features): Sequential( (conv1): BayesConv2d( (mean): Conv2d(3, 128, kernel_size=(7, 7), stride=(1, 1)) (var): LogScaleConv2d(3, 128, kernel_size=(7, 7), stride=(1, 1), bias=False))
(relu1): LeakyReLU(negative_slope=0.01) (maxpool): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False) (conv2): BayesConv2d( (mean): Conv2d(128, 256, kernel_size=(5, 5), stride=(1, 1)) (var): LogScaleConv2d(128, 256, kernel_size=(5, 5), stride=(1, 1), bias=False)) (relu2): LeakyReLU(negative_slope=0.01) (conv3): BayesConv2d( (mean): Conv2d(256, 256, kernel_size=(5, 5), stride=(1, 1)) (var): LogScaleConv2d(256, 256, kernel_size=(5, 5), stride=(1, 1), bias=False)) (relu3): LeakyReLU(negative_slope=0.01) (flatten): Flatten())
(classifier): Sequential( (fc1): Linear(in_features=6400, out_features=512, bias=True) (relu1): LeakyReLU(negative_slope=0.01) (linear): Linear(in_features=512, out_features=10, bias=True)))

Review summaries:
This paper proposes the ‘deep weight prior’: the idea is to elicit a prior on an auxiliary dataset and then use that prior over the CNN filters to jump start inference for a data set of interest.  Both explicit and implicit priors are considered, with the latter having the benefit of increased flexibility but having the drawback of a lack of a parametric form to plug in to the ELBO.  The authors address this last point by extending the ELBO appropriately.  Experiments are performed testing the prior’s ability to capture trained filters (Figure 1), provide a good initialization (Figure 2), improve sample efficiency (Figure 3), improve training speed (Figure 4).  

This paper considers learning informative priors for convolutional neural network models based on fits to data sets from similar problem domains.  For trained networks on related datasets the authors use autoencoders to obtain an expressive prior on the filter weights, with independence assumed between different layers.  The resulting prior is generative and its density has no closed form expression, and a novel variational method for dealing with this is described.  Some empirical comparisons of the deep weight prior with alternative priors is considered, as well as a comparison of deep weight samples for initialization with alternative initialization schemes.