Title: KERNEL IMPLICIT VARIATIONAL INFERENCE

Abstract: Recent progress in variational inference has paid much attention to the flexibility of variational posteriors. One promising direction is to use implicit distributions, i.e., distributions without tractable densities as the variational posterior. However, existing methods on implicit posteriors still face challenges of noisy estimation and computational infeasibility when applied to models with high-dimensional latent variables. In this paper, we present a new approach named Kernel Implicit Variational Inference that addresses these challenges. As far as we know, for the first time implicit variational inference is successfully applied to Bayesian neural networks, which shows promising results on both regression and classification tasks.

1. INTRODUCTION:

Bayesian methods have been playing vital roles in machine learning by providing a principled approach for generative modeling, posterior inference and preventing over-fitting (Ghahramani, 2015) . As it becomes a common practice to build deep models that have many parameters (LeCun et al., 2015) , it is even more important to have a Bayesian formulation to capture the uncertainty in these models. For example, Bayesian Neural Networks (BNNs) (Neal, 2012; Blundell et al., 2015) have shown promise in reasoning about model confidence and learning with few labeled data. Another recent trend is to incorporate deep neural networks as a powerful function mapping between random variables in a Bayesian network, such as deep generative models like variational autoencoders (VAE) (Kingma & Welling, 2013) .

Except a few simple examples, Bayesian inference is typically challenging, for which variational inference (VI) has been a standard workhorse to approximate the true posterior (Zhu et al., 2017) . Traditional VI focuses on factorized variational posteriors to get analytical updates (known as Meanfield VI). While recent progress in this field drives VI into stochastic, differentiable and amortized (Hoffman et al., 2013; Paisley et al., 2012; Mnih & Gregor, 2014; Kingma & Welling, 2013) , which does not rely on analytical updates anymore, factorized posteriors are still commonly used as the variational family. This greatly restricts the flexibility of the variational posterior, especially in highdimensional spaces, which often leads to biased solutions as the true posterior is usually not factorized, thus not in the family. There have been some works that try to improve the flexibility of variational posteriors, borrowing ideas from invertible transformation of probability distributions (Rezende & Mohamed, 2015; Kingma et al., 2016) . In their works, it is important for the transformation to be invertible to ensure that the transformed distribution has a tractable density.

Although utilizing invertible transformation is a promising direction to increase the expressiveness of the variational posterior, we argue that a more flexible variational family can be constructed by using general deterministic or stochastic transformations, which are not necessarily invertible. As a common result, the variational posterior we get in this way does not have a tractable density, despite that there is a way to sample from it. This kind of distribution is called implicit distributions, and for variational methods that use an implicit variational posterior (also known as variational programs (Ranganath et al., 2016) or wild variational approximations (Liu & Feng, 2016 )), we refer to them as Implicit Variational Inference (implicit VI). Most of the existing implicit VI methods (Mescheder et al., 2017; Huszár, 2017; Tran et al., 2017) rely on a discriminator to produce estimates of the variational objective and its gradients. As pointed out by many of them, the estimates are often noisy and can lead to unstable training. Besides, discriminator-based approaches are computationally infeasible when applied to nontrivial BNNs.

In this paper we present an approach named Kernel Implicit Variational Inference (KIVI), which addresses the noisy estimation problem in previous works by providing a principled way of tuning the bias-variance tradeoff. Furthermore, KIVI does not rely on a discriminator and thus is computationally feasible for models with high-dimensional latent variables (e.g., BNNs). KIVI is applicable to both global and local latent variable models, which is demonstrated by experiments on BNNs and VAEs. As far as we know, this is the first time that implicit VI is successfully applied to BNNs, which shows promising results on both regression and classification tasks.

2. BACKGROUND:

Consider a generative model p(z, x) = p(z)p(x|z), where x and z denote observed and latent variables, respectively. In VI, a variational distribution q φ (z) in some parametric family is chosen to approximate the true posterior p(z|x) by optimizing the evidence lower bound (ELBO):

L(x; φ) = E q φ (z) [log p(x|z)] -KL(q φ (z) p(z)),

where KL denotes the Kullback-Leibler divergence KL(q p) = E q [log q p ]. This objective is a lower bound of the log-likelihood log p(x) since it can be written as L(x; φ) = log p(x) -KL(q φ (z) p(z|x)). The maximum of this objective is achieved when q φ (z) = p(z|x). From Eq. ( 1), we can see that the challenge of using an implicit q φ is that calculating KL(q φ (z) p(z)) requires evaluating the density of q φ , which is intractable for an implicit distribution.

Recently, inspired by the probabilistic interpretation of Generative Adversarial Networks (GAN) (Goodfellow et al., 2014; Mohamed & Lakshminarayanan, 2016) , there have been some works that extend the GAN approach to the posterior inference of latent variable models (LVMs) (Mescheder et al., 2017; Huszár, 2017; Tran et al., 2017) . These methods all use an implicit variational family and thus can be categorized into implicit VI methods. One of their key observations is that the density ratio q φ (z) p(z) can be estimated from samples of the two distributions by a probabilistic classifier called the discriminator. They first assign class labels (y) to q and p: Let samples from q φ (z) be of class y = 1, and samples from p(z) be of class y = 0. Given an equal class prior, the density ratio at a given point can be calculated as q φ (z)/p(z) = p(z|y = 1)/p(z|y = 0) = p(y = 1|z)/p(y = 0|z), which is the ratio between the class probabilities given the data point. To estimate this, a discriminator D is trained to classify between the two classes, with a logistic loss:

EQUATION

where D(z) outputs the probability of z's being from class y = 1. Given that D is sufficiently flexible, the optimal solution of Eq. ( 2) is D(z) = q φ (z)/(q φ (z) + p(z)). Therefore, the KL divergence term in the ELBO of Eq. ( 1) can be approximated as KL(q φ p)

≈ E q φ (z) [log D(z) -log(1 -D(z))] .

This is called prior-contrastive forms of VI in Huszár (2017) . Note that the ratio approximation does not change the gradients once the approximation is accurate, as we shall see later in Eq. ( 7). Though incorporating the discriminative power in a probabilistic model has shown great success in GANs, this method still suffers from challenging problems when applied to VI:

• Noisy density ratio estimation (DRE) In VI, the variational posterior gets updated in each iteration. As shown in Eq. ( 2), the discriminator should be trained to optimum after each update. However, in practice the inner loop for training the discriminator is often truncated to one or several iterations. At the beginning of the inference procedure, it is hard for the discriminator to catch up with the variational posterior. The noisy signal produced by the discriminator leads to noisy gradients and thus unstable training. Besides, even if the discriminator quickly achieves the optimum in a small number of iterations, there is still another issue. Notice that the training loss in Eq. ( 2) is with expectations. But in practice we are using samples from the two distributions to approximate it. When the support of the distributions is high-dimensional, given the limited number of samples we use, the variance of this estimate is considerable, i.e., the discriminator tends to overfit the samples. The phenomenon is that the discriminator arrives at a state where samples are easily distinguished and the probabilities given by the discriminator are near 0 or 1, which is commonly observed in experiments (Mescheder et al., 2017) .

• Computationally infeasible for high dimensional latent variables As the density ratio is estimated by a discriminator, the samples from the two distributions of latent variables should be fed into it. However, the typically used neural network discriminator cannot afford very high-dimensional inputs (e.g., parameters in a moderate-size Bayesian neural network).

3. KERNEL IMPLICIT VARIATIONAL INFERENCE:

To address the above challenges for implicit VI, we propose to replace the discriminator with a kernel method for DRE. The advantages of this method are that it has a closed-form solution and that it allows us to explicitly tradeoff between bias and variance by tuning a regularization coefficient.

3.1. ESTIMATING THE KL TERM:

Specifically, let z ∈ R d be the latent variable, and the true density ratio is r(z) = q φ (z)/p(z).

Consider modeling it with a function r ∈ H, where H is a Reproducing Kernel Hilbert Space (RKHS) induced by a positive definite kernel k(z, z ) : R d × R d → R. Similar to kernel ridge regression, we use an objective composed of a squared loss for regression plus a penalty for the complexity of the function. For the squared loss we choose the form used by the unconstrained Least Square Importance Fitting (uLSIF) (Kanamori et al., 2009) :

EQUATION

where C is a constant, and approximate the expectation in J (r) by Monte Carlo estimates:

Ĵ (r) = 1 2n p np i=1 r(z p i ) 2 - 1 n q nq j=1 r(z q j ) + C, z p i ∼ p(z), z q j ∼ q φ (z),

where n p and n q are the number of samples from p and q, respectively. Note that in Eq. ( 3), the expectation of the squared loss is taken w.r.t. p so that the resulting form can be estimated without evaluating the density of both distributions. For the penalty term, the complexity of r is measured by its RKHS norm ( r 2 H ). Putting them together, we get the final objective:

EQUATION

)

Here λ is the regularization coefficient. Proposition 1. The optimal solution of Eq. ( 4) lies in the linear subspace spanned by the kernel functions centered at the samples ({z p i } np i=1 , {z q j } nq j=1 ), i.e., r has the form:

EQUATION

Proof. This can be seen as the generalization of the representer theorem (Schölkopf et al., 2001) to the density ratio problem. So the proof follows the same procedure. See Appendix A.

Substituting Eq. ( 5) into Eq. ( 4) and setting the derivatives w.r.t. α and β to zeros, we get the optimal solution (a detailed derivation is given in Appendix B):

EQUATION

where (K p ) i,j = k(z p i , z p j ) and (K pq ) i,j = k(z p i , z q j ). We use the common RBF kernels k(z, z ) = exp -zz 2 2 /2σ 2 . σ is the kernel bandwidth, which is determined by the commonly used median heuristic (the median of pairwise distances of the sample points).

Once we have the approximate density ratio function r, a Monte Carlo estimate of KL(q φ (z) p(z)) can be constructed by 1 nq nq i=1 log r(z q i ). Note that there is a constraint that the estimated density ratio should be non-negative. However, we do not involve it in the optimization objective in order to get a closed-form solution, which indicates that some post-processing is needed to ensure this property. We solve the issue by clipping the estimated density ratio. The clipping values are searched from {10 -8 , 10 -16 , 10 -32 }. In experiments we found that the algorithm is not sensitive to the clipping value. This is due to the accurate estimation guaranteed by the global optimum in the RKHS, which is a universal family when RBF kernels are used (Carmeli et al., 2010) .

The reverse ratio trick Another technique is essential to improve the estimation of the KL term, which we call the reverse ratio trick. The key observation is that the expectation in the squared loss J (r) in Eq. ( 3) is taken w.r.t. p, whereas the expectation in the KL term (KL(q p)) is taken w.r.t. q. Unless p and q match very well in where they put most probabilities, a small squared loss does not always mean a good KL estimate. The solution is by a simple trick. Instead of estimating q p , we choose to estimate r pq = p q and compute the KL term as -E q log p q . We denote the estimated reverse density ratio as rpq , then the corresponding KL estimate is -E q log rpq . Note that in this way the squared loss changes to J (r pq ) = 1 2 (r pq (z) -r pq (z)) 2 q φ (z) dz, whose expectation is taken w.r.t. the same probability measure (q) as the KL term's. As we shall see in experiments (Appendix F.1), the trick is essential to make the estimation sufficiently accurate for VI.

Gradient computation:

We now consider how to estimate the gradients of the KL term w.r.t. variational parameters φ. First it is easy to prove as in Huszár (2017) that

EQUATION

)

A detailed proof is in Appendix C. Eq. ( 7) indicates that the true gradients of the KL term w.r.t. φ do not flow through the density ratio function. We now replace the ratio on the right side with rpq : ∇ φ KL(q φ p) ≈ -∇ φ E q φ log rpq . Note that without Eq. ( 7) we cannot do the approximation since rpq has zero gradients w.r.t. φ. Then, the reparameterization trick (Kingma & Welling, 2013) can be used:

-∇ φ E q φ log rpq = -E ∼N (0,I) ∇ φ log rpq (z q ( ; φ)).

3.2. THE ALGORITHM:

We have constructed a closed-form estimate for the KL term and show its gradients can be estimated by the reparameterization trick. Note that the reparameterization trick can also be used to compute the gradients of the reconstruction term in Eq. ( 1) and thus can be applied to the ELBO. See Algo. 1 for the complete algorithm. Note that the number of samples (M ) used in the reconstruction term can be different from that required for the KL estimation, which can be reduced when the model is expensive (e.g., we set M = 1 in the experiments of VAEs). Thus compared to normal reparameterized VI, the extra computational cost is mainly in calculating the inverse of the n p × n p matrix in Eq. ( 6). As we shall see in experiments, tens or a hundred samples are sufficient to obtain a stable KL estimate, so the added cost is not high.

Algorithm 1 Kernel Implicit Variational Inference (KIVI)

Require: Observed data x, model p θ (x|z)p(z). Require: Implicit variational posterior q φ (z|x), n p , n q , M . 1: repeat 2:

Sample from the prior:

z p i ∼ p(z), i = 1, . . . , n p . 3:

Sample from the variational posterior: z q j ∼ q φ (z|x), j = 1, . . . , n q .

4:

Compute the density ratio rpq by Eq. ( 5), ( 6) and clip rpq to be positive at z q s. 5:

Compute KL = -1 nq nq j=1 log rpq (z q j ) and L = 1 M M m=1 log p(x|z q m ) -KL.

6::

Estimate ∇ φ L with the reparameterization trick.

7::

Do gradient ascent with ∇ φ L.

8:

(Optional) For parameter learning, do gradient ascent with ∇ θ L. 9: until Convergence KIVI addresses the two challenges stated in Sec. 2. First, the ratio estimates are given in closed-forms, thus not having the problem of not catching up. Second, the bias-variance trade-off of the estimation can be controlled by the regularization coefficient λ. When λ is set smaller, the estimation is more aggressive to match the samples. When λ is set larger, the estimated ratio function is smoother.

Choosing an appropriate λ, the variance of the gradients can be controlled, compared to the extreme ratio estimates given by discriminators when their output probabilities are near 0 or 1. Moreover, KIVI is directly applicable to both global and local latent variable models (LVMs), which is an advantage over nonparametric VI methods like particle mirror descent (Dai et al., 2015) and Stein variational gradient descent (SVGD) (Liu & Wang, 2016) . For the task of training local LVMs like VAEs, we additionally use the adaptive contrast (AC) technique (Mescheder et al., 2017) , whose details are summarized in Appendix D.

4 EXAMPLE: IMPLICIT VARIATIONAL BAYESIAN NEURAL NETWORKS Now we present an example for using KIVI in Bayesian neural networks (BNNs), which have received increasing attention due to their ability to model uncertainty, an important factor in many tasks such as adversarial defense and reinforcement learning. However, despite that we have removed the need for a discriminator, it is still nontrivial to apply KIVI to BNNs because we need to design an implicit posterior that outputs very high-dimensional samples of latent variables (weights). Existing implicit posteriors (Mescheder et al., 2017; Song et al., 2017) based on traditional fully-connected neural networks cannot handle such a high-dimensional output space. We present Matrix Multiplication Neural Network (MMNN), an efficient architecture for sampling large matrices. Deploying MMNN, KIVI can easily scale up to large BNNs.

In BNNs, a prior is specified over the neural network parameters W = {W l } L l=1 , where W l indicates weights in the l-th layer. Given an input x, the output y is modeled with

W ∼ N (0, I), ŷ = f NN (x, W), y ∼ P(ŷ; θ),

where ŷ is the output of the feed-forward network f NN , and y is of a distribution P parameterized by ŷ and θ. For regression, P is usually a Gaussian with ŷ as the mean. For classification, P is usually a discrete distribution with ŷ as the unnormalized log probabilities.

The true posterior of W in BNNs is intractable. Thus we turn to VI and use a variational posterior q to approximate it. Denoting the dataset with

X = {x i } N i=1 , Y = {y i } N i=1 , we have the ELBO: L(Y, X; φ) = E q φ (W) log p(Y|X, W) -KL(q φ (W) p(W)).

The variational posterior is usually set to be factorized by layer: q φ (W) = L l=1 q φ l (W l ). However, previous methods used variational posteriors with a limited capacity for each q φ l (W l ), including factorized Gaussian (Hernandez-Lobato & Adams, 2015) , matrix variate Gaussian (Louizos & Welling, 2016; Sun et al., 2017) and normalizing flows (Louizos & Welling, 2017) . Enabled to learn implicit variational posteriors, we propose to adopt a general distribution without an explicit density function, which has a form of

W 0 l ∼ N (0, I), W q l = g φ l (W 0 l ). Algorithm 2 MMNN Require: Input matrix X 0 Require: Network parameters {A l i , B l i , A r i , B r i } L i=1 1: for i = 1, . . . , L do 2:

Left multiplication:

X i = A l i X i-1 + B l i 3:

Right multiplication:

X i = X i A r i + B r i 4: if i ≤ L -1 then 5: X i = Relu (X i ) 6: end if 7: end for 8: Output X L

Here g is a transformation parameterized by φ l , and W q l are treated as samples from q. The key challenge is that W l are very high dimensional for moderate size neural networks. Thus, we often cannot use a fully connected neural network (MLP) as g. Inspired by low-rank matrix factorization (Koren et al., 2009) , we propose a new kind of network called Matrix Multiplication Neural Network (MMNN) to serve as g, as shown in Alg. 2. In each layer of an MMNN, an input matrix X i (M in × N in ) is left multiplied with a parameter matrix A l i (M out × M in ) and is added a bias matrix B l i (M out × N in ), then it is right multiplied with a parameter matrix A r i (N in × N out ) and is added a bias matrix B r i (M out × N out ). Finally it is passed through a nonlinear activation (e.g., ReLU). We call such a layer as an M out ×N out Matrix Multiplication layer.

To model the implicit posterior of W l , we only need to randomly sample a matrix W 0 l of smaller size, and propagate it through the MMNN to get the output variational samples (W q l ):

W 0 l ∼ N (0, I), W q l = MMNN φ l (W 0 l ).

When modeling a matrix, MMNN has significant computational advantages over MLPs, due to its low-rank property. For example, to model an M × N weight matrix, consider a single-layer MMNN with the input matrix W 0 of size M 0 × N 0 , the parameters needed are A l 1 , B l 1 , A r 1 , B r 1 and they are in total of size M M 0 + M N 0 + N 0 N + M N , while if a single fully-connected layer is used, the parameter size is M 0 N 0 M N , which is much larger. Thus, we can use an MMNN as g in the variational posterior for normal-size neural networks. In tasks with very small networks, we still use an MLP as g.

5. RELATED WORK:

Our work closely relates to the works on implicit generative models (IGMs, generative models that define implicit distributions) and density ratio estimation (DRE). IGMs have drawn much attention due to the popularity of GANs. General learning algorithms of implicit models have been surveyed in Mohamed & Lakshminarayanan (2016) , where DRE plays a central role. The connection between DRE and GANs is also discussed in Uehara et al. (2016) . For a comprehensive review of DRE, we refer the readers to the survey (Hido et al., 2011) . We also refer the readers to many other works by Sugiyama and his collaborators on DRE, such as KLIEP (Sugiyama et al., 2008) , LSIF (Kanamori et al., 2009) , and DRE based on Bregman divergence (Sugiyama et al., 2012) .

Our work also builds upon the recent VI methods, including stochastic approximation by mini-batches (Hoffman et al., 2013) , direct gradient optimization of variational lower bounds (Paisley et al., 2012; Mnih & Gregor, 2014) , and the reparameterization trick for training continuous LVMs (Kingma & Welling, 2013) . Following the success of learning with IGMs, implicit distributions are applied to VI. Many of them are based on discriminators, which can be divided into two categories: prior-contrastive (PC) and joint-contrastive (JC) (Huszár, 2017) . In PC methods discriminators distinguish between samples from the prior and those from the variational posterior, while in JC methods they distinguish between the model joint distribution and the joint distribution composed of the data distribution and the variational posterior. Concurrent with Huszár (2017), Mescheder et al. (2017) proposed Adversarial Variational Bayes (AVB), which is an amortized version of PC methods for training local LVMs like VAEs. Prior to Huszár (2017), similar ideas with JC methods have been proposed in ALI (Dumoulin et al., 2016) and Bi-GAN (Donahue et al., 2016) . Nonparametric VI methods such as PMD (Dai et al., 2015) and SVGD (Liu & Wang, 2016) that adapt a set of particles towards the true posterior are also closely related to implicit VI. They share the similar advantage of flexible approximations. More recently, the amortized version of SVGD has been developed (Liu & Feng, 2016) and the same idea has been applied to MCMC (Li et al., 2017) . It was further shown in Li & Turner (2017) that the core identity in SVGD (Stein's identity) could also be employed to approximate the gradients of implicit distributions. We present empirical results on both synthetic and real datasets to demonstrate the benefits of KIVI. All implementations are based on ZhuSuan (Shi et al., 2017) .

6. EXPERIMENTS:



6.1. TOY 1-D GAUSSIAN MIXTURES:

We firstly conduct a toy experiment to approximate a 1-D Gaussian mixture distribution with VI. The Gaussian mixture distribution has two equally distributed unit-variance components whose means are -3 and 3. We compare KIVI with VI using a single Gaussian posterior (Fig. 1 ). The variational distribution used by KIVI generates samples by propagating a standard normal distribution through a two-layer MLP with 10 hidden units in each layer and one output unit. As shown, the Gaussian posterior converges to a single mode. In contrast, KIVI can accurately approximate the two modes with an expressive variational posterior. We defer another toy experiment on 2-D Bayesian logistic regression to Appendix F.1, where the importance of the reverse ratio trick is illustrated.

6.2. BAYESIAN NEURAL NETWORKS (BNNS):

As stated in Sec. 4, the latent variables in BNNs are global to all data points and are usually very high-dimensional, for which a flexible variational family is essential. We compare KIVI with state-of-the-art VI methods by doing regression and classification on standard benchmarks.

6.2.1. REGRESSION:

To quantitatively measure the predictive ability of BNNs with KIVI as the inference method, we use standard multivariate regression benchmarks from recent works (Table 1 ), such as probabilistic backpropagation (PBP) (Hernandez-Lobato & Adams, 2015) . We compare with state-of-the-art methods: the Bayesian interpretation of dropout (Gal & Ghahramani, 2016) and stein variational gradient descent (SVGD) (Liu & Wang, 2016) 1 . Following the setup in PBP, we use BNNs with one 50-unit hidden layer except in the two large datasets, i.e., Protein Structure and Year Predication MSD, where 100 units are used. We randomly select 90% of the whole dataset for training and leave the rest for testing. We also put a Gamma prior on the precision of the observation noise to adaptively learn it (see Appendix E). For all datasets, we set n p = n q = M = 100, λ = 0.001 and set the batch size to 100 and the learning rate to 0.001. The model is trained for 3000 epochs for the small datasets with less than 1000 data points, and 500 epochs for the others. We report the mean errors and standard deviations averaged over 20 runs, except 5 runs for Protein Structure and 1 run for Year Predication MSD. As networks used in these tasks are of a small scale, we use MLPs with one hidden layer in the implicit variational posterior (see Appendix G.2.1 for details).

Table 1 shows the results with the best ones marked in bold. Results of SVGD and dropout are cited from their papers, which have the same setting as ours. We can see that KIVI consistently outperforms SVGD and dropout on both RMSE and test-LL for most datasets. Especially on RMSE, KIVI has significant improvements over them except on Wine and Year Predication MSD. It suggests that KIVI enables the implicit variational posterior to capture the predictive uncertainty in network parameters, which is hard to be fully described by a mixture of two delta distributions (dropout) and a fixed set of particles (SVGD). We emphasize that although the nonparametric nature of SVGD has also made the approximation more flexible, it uses the same set of particles throughout the inference procedure, while each iteration of KIVI generates a new set of particles. Thus the implicit posterior learned by KIVI is smoothed by the parametric model. Recently, normalizing flows have shown good performance on BNNs (Louizos & Welling, 2017) . So we also experiment with directly applying normalizing flows to this task. The results are reported in Appendix F.2.

SGD (Simard et al., 2003 ) 800 1.3m 1.6% Dropout (Srivastava et al., 2014) ≈ 1.3% Dropconnect (Wan et al., 2013) 

6.2.2. CLASSIFICATION:

For classification, we present the results on MNIST, which consists of 60,000 training images and 10,000 test images of handwriting digits. Compared to the above datasets in regression, MNIST has a much higher feature dimension, introducing millions of parameters even in moderate-size networks, which brings big challenges for BNNs. As a standard benchmark, the performance on MNIST can be improved by many other techniques, such as convolution, generative pre-training, data augmentation, etc. To ensure a fair comparison, we follow the settings from Bayes-By-Backprop (Blundell et al., 2015) and focus on improving the performance of ordinary MLPs without using any of these techniques. The network structures used are three MLPs, all with two ReLU hidden layers, and the layer sizes are 400, 800 and 1200, respectively. For KIVI, we used MMNNs with two hidden matrix multiplication layers in the implicit posterior (see Appendix G.2.2 for details). We set n p = n q = M = 10, λ = 0.001, and train for 300 epochs with the batch size as 100. The initial learning rate is 0.001 and is annealed every 100 epochs by ratio 0.5. We used the last 10,000 samples of the training set as the validation set for model selection.

Fig. 2 summarizes the results. We can see that KIVI achieves better accuracy compared to plain SGD (Simard et al., 2003) , dropout (Srivastava et al., 2014) and Bayes-By-Backprop (Blundell et al., 2015) on all three types of MLPs. KIVI even performs better than Bayes-By-Backprop with a changed prior (scale mixture), which makes the model itself more flexible than ours. When the layer size is 800, our result is comparable to that of an ensemble of 5 networks with dropconnect (Wan et al., 2013) , which demonstrates that the implicit posterior has been learned to account for most model uncertainty.

We also conduct experiments with the prior-contrastive (PC) method (the counterpart of AVB for global latent variables, see Sec. 2). The key challenge for applying PC here is that the posterior samples are extremely high-dimensional, and if fed into discriminators like neural networks, they will cause unaffordable computation cost. To get around this, we use a logistic regression as the discriminator in PC. The experiment settings of PC are reported in Appendix G.2.2. The training lower bounds of the two methods are plotted in Fig. 2 . We can see that in the beginning they increase at the same pace, then PC fails to converge with lower bound explosion while KIVI improves consistently. The explosion is mainly because the input to the discriminator is of hundreds of thousands of dimensions, and plain logistic regression cannot produce reliable density ratio estimates. We also experiment with PC for layer size 800 and 1200. They both fail to converge in the end.

6.3. VARIATIONAL AUTOENCODERS:

As stated in Sec. 3.2, KIVI is applicable to both global and local LVMs, and the latter can be learned using an amortized scheme (i.e., use q φ (z|x) instead of q φ (z)). Here we present an application on where z are latent features, x are observations, and P is the output distribution for modeling the observations, which takes the outputs of the neural network (f NN (z)) as parameters. We conduct experiments on two widely used datasets for generative modeling: binarized MNIST and CelebA (Liu et al., 2015) . P is a Bernoulli distribution for binarized MNIST, while a normal distribution for CelebA. For VAE the variational lower bound has the same form as Eq. ( 1), except that q φ (z) is replaced by q φ (z|x). The original VAE parameterizes q φ (z|x) as

z = µ φ (x) + • σ φ (x), µ φ (x), σ φ (x) = g NN (x; φ), ∼ N (0, I),

where g NN is a neural network that outputs the parameters of the normal distribution. In the MNIST case, g NN is an MLP with two hidden layers, which is illustrated in Fig. 3a (left). To form an implicit posterior, a direct choice is to move the stochastic noise from the output layer to the penultimate hidden layer, as illustrated by Fig. 3a (right).

Before applying KIVI, a crucial question is what we expect to get by using implicit posteriors for training VAEs. One target could be that we may get tighter lower bounds of the data log-likelihood (LL) because the algorithm searches in a larger variational family for the optimal lower bound. This suggests, however in a very weak way, that doing optimization in the larger space will lead to better test LL, given the optimization always arrives at local optima. Previously Adversarial Variational Bayes (AVB) has shown some results on MNIST, by comparing the test LL of the plain VAE and the VAE trained by AVB, using golden truths estimated by annealed importance sampling (AIS) (Wu et al., 2016) . However, for the results reported in AVB, the model architectures used by the plain VAE and AVB are very different, which leads to concerns about which part of the change contributes to the improved likelihoods.

Here we adopt another setting to better demonstrate the gain from implicit posteriors. We observe that the key improvement of implicit posteriors is that objectives with them average over a much broader range of posterior configurations. This effect not only contributes to a larger search space that contains tighter lower bound values, but also makes the VAE model better prevent overfitting.

To verify that KIVI keeps this property, we conduct experiments on a statically binarized MNIST dataset and use models with no prior knowledge of the problem (MLPs instead of convnets), which is a typical setting that leads to overfitting. The latent dimension of the VAE model is 8, and f NN (z) is an MLP with two hidden layers of size 500. The parameters for KIVI are n p = n q = 100, M = 1. To demonstrate that KIVI scales to larger models, we trained a VAE with the same network structure used by DCGAN (Radford et al., 2015) on CelebA using KIVI. The latent dimension in this case is 32. The implicit posterior is constructed in a way similar to the one shown in Fig. 3a , with the bottom hidden layers symmetric to the decoder network (See Appendix G.3 for details). To visually check the latent space learned by KIVI, we show the reconstruction results of linearly interpolating between the latent z vectors of two real images after 25 epochs (Fig. 4 ), when the model has converged.

Compared to the latent space learned by AVB after the same epochs (we use the public code from AVB and set the same decoder structure), we find ours are smoother, and the interpolated images are much sharper. More interpolation results through the training process are presented and compared in Appendix F.5. We also use the learned model to generate 10,000 images and evaluate the sample quality using Fréchet Inception Distance (FID) (Heusel et al., 2017) . The FID scores achieved at epoch 25 by AVB and KIVI are 160 and 41, respectively (smaller is better). In fact many efforts are required to make AVB successfully train a model for CelebA to produce results shown in the figure.

As reported in Mescheder et al. (2017) , the log prior log p(z) is explicitly added to the discriminator (T (x, z)), while KIVI does not need much tuning: there is no need to carefully design a discriminator, and the only two hyper-parameters (i.e., λ and the clipping value) both have clear meanings.

7. CONCLUSIONS:

We present an implicit VI method named Kernel Implicit Variational Inference (KIVI), which provides a principled way of tuning bias-variance tradeoff and makes implicit VI computationally feasible for models with high-dimensional latent variables. We successfully applied this approach to Bayesian neural networks and achieved superior performance on both regression and classification tasks. We also demonstrate that KIVI can be applied to learn local latent variable models like VAEs. Future work may include applying this method to larger-scale networks and improving the kernel estimator further.

C GRADIENTS OF THE KL TERM

∇ φ KL(q φ ||p) = ∇ φ E q φ log q φ p = ∇ φ q φ (z) log q φ (z) p(z) + q φ (z)∇ φ log q φ (z) p(z) dz = ∇ φ E q φ log q p + ∇ φ q φ (z)dz = ∇ φ E q φ log q p .

The formula above shows that a good density ratio estimator gives accurate gradient estimation of φ.

D KIVI WITH ADAPTIVE CONTRAST:

Although KIVI gives rather good estimation of the density ratio, the estimation accuracy still degrades with larger discrepancy between p and q. The problem is very critical for local latent variable models like VAEs because the same variational model is required to infer posteriors of all local latent variables.

In order to mitigate that, AVB (Mescheder et al., 2017) adopted a technique called Adaptive Contrast (AC), which can easily be integrated with KIVI. AC introduces an auxiliary tractable distribution r α (z|x) that resembles q. With r α (z|x), the ELBO can be rewritten as

L(x; φ) = E q φ (-log r α (z|x) + log p(x, z)) -KL(q φ (z|x)||r α (z|x)).

Gradients of the first term w.r.t. φ can be easily computed using Monte Carlo, and gradients of the second term can be estimated using KIVI. Adaptive contrast gives better estimates if r α (z|x) approximates q well. Because r is required to have a tractable density, a commonly used adaptive distribution is a Gaussian distribution whose mean µ r and standard derivation σ r match with q. In practice µ r and σ r are estimated from the samples of q. According to the invariance of KL divergence under reparameterization, we have

KL(q φ (z|x)||r α (z|x)) = KL(q φ (ẑ|x)||r 0 (ẑ)),

where qφ (z|x) denotes the distribution of ẑ = z-µr σr and r0 (ẑ) denotes the standard normal distribution. Under this reparameterization, we only need to estimate the density ratio between two distributions with zero means and unit variances.

E LOWER BOUND WITH GAMMA-PRIOR PRECISION:

In the multivariate regression task, the output is sampled from a normal distribution with ŷ (x, W) as the mean and a parameter as the variance. The variance controls the likelihood of the model, therefore, choosing an appropriate variance is essential. We place a Gamma prior Gamma (6, 6) on its reciprocal (i.e., the precision of the normal distribution). The variational posterior we used is q(W, λ) = q(W)q(λ), q(λ) ∼ Gamma(α, β). Then the ELBO can be calculated as

L = E q(W) E q(λ) log p (y|x, W, λ) -KL (q (W) p (W)) -KL (q (λ) p (λ)) = E q(W) E q(λ) log N (y | ŷ(x, W), 1 λ ) -KL (q (W) p (W)) -KL (q (λ) p (λ)) = 1 2 E q(W) E q(λ) log λ -λ (y -ŷ (x, W)) 2 -log 2π -KL (q (W) p (W)) -KL (q (λ) p (λ)) = 1 2 E q(W) ψ (α) -log β - α β (y -ŷ (x, W)) 2 -log 2π -KL (q (W) p (W))

-KL (q (λ) p (λ)) ,

where ψ (x) is the digamma function and KL (q(λ) p(λ)) can be calculated in closed-form. where w, x i ∈ R 2 ; σ is the sigmoid function. N = 200 data points ({(x i , y i )} N i=1 ) are generated from the true model as the training data (Fig. 5a ). The unnormalized true posterior is plotted in Fig. 5b . As a baseline, we first run VI with a factorized normal distribution. The result is shown in Fig. 5c . It can be clearly seen that the factorized normal can capture the position and the scale of the true posterior but cannot fit well to the shape due to its independence across dimensions.

We then apply KIVI. The implicit posterior we use is a simple stochastic neural network (see Appendix G.1). To demonstrate how good the result is, we also run Hamiltonian Monte Carlo (HMC) to get posterior samples. The results are plotted in Fig. 5d and 5e . We can see that the implicit posterior is learned to capture the strong correlation between the two dimensions and can produce posterior samples that have a similar shape with the samples drawn by HMC. We also use this experiment to illustrate the importance of the reverse ratio trick. See Figure 6 for the implicit variational distribution learned by only optimizing KL(q φ (w) p(w)). In this way we expect the learned q to be close to the prior N (0, I). The result produced by using the trick is compared to the result without it. We can see that the latter fails to work well.

F.2 COMPARISON WITH MORE METHODS:

In this section we present comparisons with two more methods towards flexible posteriors, namely, normalizing flow (Rezende & Mohamed, 2015) and KSD variational inference (KSD VI) (Liu & Feng, 2016) . We also include the results by HMC as the ground truth.

Normalizing flow:

The basic idea of normalizing flow has been introduced in Section 1. Specifically, given a random variable z ∈ R d following a simple distribution q(z), and an invertible mapping T : R d → R d so that z = T (z), the probability density of the transformed variable z can be calculated as

EQUATION

)

Thus we can construct complex distributions by composing invertible mappings (T ), while keeping the probability density of the result distribution tractable by successively applying Eq. ( 10). For 

T (z) = z + uh(w z + b),

where u, w ∈ R d , b ∈ R are free parameters, and h is a smooth element-wise nonlinearty, chosen as Tanh in the following experiments. A simple variational posterior can be made more expressive when this parametric transformation is employed.

KSD VI KSD variational inference (Liu & Feng, 2016 ) is a method that directly minimizes the kernelized Stein discrepancy (KSD) between the true posterior (p) and the variational posterior (q): S(q, p) = max

EQUATION

where H d is a unit ball in the vector-valued RKHS induced by the RBF kernel k(z, z ) = z-z 2 2 2σ 2 , and s q (z) = ∇ z log p(z|x). Note that the objective in Eq. ( 11) only requires samples from q, so KSD VI also belongs to implicit VI methods.

We conduct the regression experiments in Section 6.2.1. The results are shown in Table 2 . For normalizing flow, we apply 10 planar flows on the weights to match the running time of our implicit posteriors. To see whether flows help the inference, we also present results of VI using factorized normal distributions on the weights (with their means and standard deviations optimized by the reparameterization trick). For KSD VI, we use the same implicit posteriors as those we used for KIVI in Section 6.2.1. For VI with factorized normal distributions and normalizing flow, we use 100 samples, batch size 10 except that for kin8nm and naval we use batch size 100. We set the learning rate to 0.01 and run 500 epochs for 20 times. For KSD VI, we set all the training parameters (number of samples, number of epochs, batch size, and learning rate) the same as KIVI's. We also run HMC to produce the ground truths. For HMC, we use 20 chains, 150000 iterations and set the target acceptance rate to 97% to adapt the step size. As the HMC experiment is time-consuming, we only perform 10 runs.

From Table 2 we can see that normalizing flow does not show improvements over VI with factorized normal distributions. This is probably due to optimization challenges caused by the limited form of planar flows, thus the inference procedure takes little benefit from the flexibility introduced by the flow. For KSD VI, we found it is very sensitive to the initialization of implicit posteriors. We had to set the variance of the input Gaussian noise larger so that KSD VI would not diverge at the very beginning of training. KSD VI also soon converges to unsatisfying local optima after the optimization process starts. These two findings are well explained by the conclusion that KSD is the magnitude of a functional gradient of KL divergence (Liu & Wang, 2016) , then all saddle points in the original problem of optimizing the KL divergence become local optima when optimizing KSD.

F.3 VISUALIZATION OF INFERRED POSTERIORS:

In order to visually check the quality of the uncertainty estimated by KIVI, we use a visualization technique named parallel coordinates (Inselberg & Dimsdale, 1987) to plot the posterior over weights. We compare the posteriors inferred in the regression experiment on Boston housing (Table 2 ) by VI with factorized normal approximation, HMC, and KIVI.

The feature dimension of the Boston housing data is 13. And the BNN used is an MLP with a hidden layer of size 50. So the network has two weight matrices: W 0 ∈ R 14×50 and W 1 ∈ R 51×1 (The bias parameters are included). Since W 0 has 700 dimensions, we only plot the posterior samples of W 1 to avoid visual clutter. Specifically, we draw 100 samples from the posterior: W

(1:100) 1 ∼ q(W 1 ), and the goal is to show these 51-dimensional samples. In parallel coordinates each sample is plotted as a polyline (see Figure 7 ). The vertices on the polyline represent each single dimension. Their positions on the horizontal axis are the indices of the dimension (from 0 to 50). And the vertical coordinates represent the weight values. Note that an important fact about hidden neurons in neural networks is that they are non-identifiable (any two hidden nodes can be exchanged without affecting the output distribution). This indicates that all dimensions of W 1 are non-identifiable. Different inference algorithms may converge to different local modes caused by this symmetry. To make the visualizations comparable, we sort the dimensions of W 1 for each algorithm by the mean value of posterior samples in each dimension.

From the visualization we could see that BNNs with factorized normal approximation have significant over-pruning problems. A large proportion of hidden nodes are turned off during the inference and the information is mainly carried by several others. These pruned weights can be identified by their low signal-to-noise ratio |µ| σ , where µ is the mean, and σ is the standard deviation. This problem has been pointed out previously, both in VAE works (Sønderby et al., 2016; Hoffman, 2017) and BNN works (Blundell et al., 2015) , and can be explained by the looseness of the variational bound when factorized approximation is used (Trippe & Turner, 2017) . In contrast, the ground truth by HMC does not have the pruning problems. And there are very strong correlations captured if we observe the neighboring dimensions.2 KIVI also does not have the pruning problems and could capture the strong correlations across the dimensions. And with the gain in accuracy, there is still a good amount of uncertainty in the implicit posterior. Despite the weight dimensions are non-identifiable, we could still see that the two VI methods arrive at biased solutions compared to the ground truth by HMC in terms of scales. Note that this is not necessarily problematic since VI is typically known to produce biased solutions.

F.4 ACCURACY OF KL ESTIMATION:

From Section 3.1 we know that the approximate gradients of the ELBO are directly related to the KL estimates. So we would like to assess the accuracy of the KL estimator. We adopt the settings from the VAE experiment on MNIST (Section 6.3). For comparison, we must also be able to compute a ground truth of the KL term. To achieve this, we use normalizing flow in q(z|x), which has a complicated but tractable density. Thus we can get a good Monte Carlo estimate of the true KL term: KL(q φ (z|x) p(z)) 1 m m i=1 log q φ (zi|x) p(zi) , z i ∼ q φ (z|x). In Figure 8a we compare the KL term estimated using KIVI with the ground truth. Note that since we use adaptive-contrast (AC) (see Appendix D) in the VAE experiments, where the KL term is broken down into two parts, it should make more sense to look at the only part that uses the density ratio estimator (the KL divergence between the standardized q and a standard normal distribution), which is plotted in Figure 8b . We can see that the KL estimates closely track the ground truth, and are more accurate as the variational approximation improves over time. 1-D Gaussian Mixture The implicit posterior generates samples by propagating samples from a standard normal distribution through a two-layer MLP with 10 hidden units and one output unit. We set the regularization coefficient λ to 0.003 and the density ratio clipping threshold to 10 -8 .

2-D Bayesian Logistic Regression:

The inputs X are 200 points randomly sampled from U[-5, 5] × U [-5, 5] . The outputs Y are the predictions of X with randomly sampled weights from the prior.

For HMC, we run 100 chains, 200 iterations each, and use 10 leapfrog steps. The step size is automatically adapted using dual averaging, starting from 0.001. We discard the first 100 samples generated. For factorized VI, the training is run for 100 epochs and 100 samples are used. In the training, we anneal the learning rate linearly according to lr = 100 100+epoch-1 . For KIVI we follow the same setting, except that we use 1k samples. The regularization coefficient λ and the minimal density ratio are set to 0.1 and 10 -8 , respectively. Below we describe the sample generation process of the 

:

Note that VMG(Louizos & Welling,

2016) and PBP-MV(Sun et al., 2017) used adaptive weight priors, which are different from the common setting of standard normal priors; the former also additionally used variational dropout, thus their results are not directly comparable to those of the works discussed here as well as ours.

Note that in HMC the samples plotted are drawn from a single chain. This is also because the nonidentifiability of weights, since different chains with different initializations tend to converge to different local modes that cannot be identified from each other. So if we plotted all the chains, there were too much visual clutter, and to be fair, we would need to run the two VI methods with different initializations.

Figures and Tables:

Figure 1: Fitting Gaussian Mixture distribution

Figure 2: Results for MNIST classification. The left table shows the test error rates. indicates results that are not directly comparable to ours: Wan et al. (2013) used an ensemble of 5 networks, and the second part of Blundell et al. (2015) changed the prior to a scale mixture. The plot on the right shows training lower bound in MNIST classification with prior-contrastive and KIVI.

Figure 3: Variational Autoencoders: (a) Gaussian posterior vs. implicit posterior, where fc denotes a fully-connected layer. They are used by the plain VAE and KIVI, respectively; (b) Training and evaluation curves of the lower bounds on statically binarized MNIST.

Figure 4: Interpolation experiments for CelebA: AVB (left); KIVI (right).

Figure 5: 2-D Bayesian logistic regression

Figure 6: Variational distributions produced by only optimizing KL(q(w) p(w)): (a) With the reverse ratio trick; (b) Without the reverse ratio trick.

Figure 7: Visualization of learned posteriors for regression on Boston housing.

Figure 9: Epoch 1

Figure 11: Epoch 10

Average test set RMSE, predictive log-likelihood for the regression datasets.

Table content: <table><tr><td>Dataset</td><td/><td>Avg. Test RMSE</td><td/><td/><td>Avg. Test LL</td></tr><tr><td/><td>SVGD</td><td>Dropout</td><td>KIVI</td><td>SVGD</td><td>Dropout</td><td>KIVI</td></tr><tr><td>Boston</td><td colspan="6">2.957±0.099 2.97±0.19 2.798±0.173 -2.504±0.029 -2.46±0.06 -2.527±0.102</td></tr><tr><td colspan="7">Concrete 5.324±0.104 5.23±0.12 4.702±0.116 -3.082±0.018 -3.04±0.02 -3.054±0.043</td></tr><tr><td>Energy</td><td colspan="6">1.374±0.045 1.66±0.04 0.467±0.015 -1.767±0.024 -1.99±0.02 -1.298±0.005</td></tr><tr><td>Kin8nm</td><td colspan="6">0.090±0.001 0.10±0.00 0.075±0.001 0.984±0.008 0.95±0.01 1.162±0.008</td></tr><tr><td>Naval</td><td colspan="6">0.004±0.000 0.01±0.00 0.001±0.000 4.089±0.012 3.80±0.01 5.501±0.121</td></tr><tr><td colspan="7">Combined 4.033±0.033 4.02±0.04 3.976±0.037 -2.815±0.008 -2.80±0.01 -2.794±0.009</td></tr><tr><td>Protein</td><td colspan="6">4.606±0.013 4.36±0.01 4.255±0.019 -2.947±0.003 -2.89±0.00 -2.868±0.005</td></tr><tr><td>Wine</td><td colspan="6">0.609±0.010 0.62±0.01 0.629±0.008 -0.925±0.014 -0.93±0.01 -0.958±0.015</td></tr><tr><td>Yacht</td><td colspan="6">0.864±0.052 1.11±0.09 0.737±0.068 -1.225±0.042 -1.55±0.03 -2.123±0.010</td></tr><tr><td>Year</td><td colspan="2">8.684±NA 8.849±NA</td><td>8.950±NA</td><td colspan="2">-3.580±NA -3.588±NA</td><td>-3.615±NA</td></tr></table>

More details can be found in Appendix G.3. Fig 3b shows the training and testing curves of VAEs

Table content: <table/>

Test RMSE, log-likelihood for the regression datasets. Factorized and NF represent VI with factorized normal posteriors and normalizing flow, respectively.

Table content: <table><tr><td>RMSE</td><td>Factorized</td><td>NF</td><td>KSD VI</td><td>KIVI</td><td>HMC</td></tr><tr><td>boston</td><td>3.42±0.19</td><td>3.43±0.19</td><td>4.10±0.25</td><td>2.80±0.17</td><td>2.20±0.05</td></tr><tr><td>concrete</td><td>6.00±0.10</td><td colspan="2">6.04±0.10 12.49±0.19</td><td>4.70±0.12</td><td>4.27±0.13</td></tr><tr><td>energy</td><td>2.42±0.06</td><td>2.48±0.09</td><td>5.54±0.14</td><td>0.47±0.02</td><td>0.47±0.01</td></tr><tr><td>kin8nm</td><td>0.09±0.00</td><td>0.09±0.00</td><td>0.26±0.00</td><td>0.08±0.00</td><td>0.07±0.00</td></tr><tr><td>naval</td><td>0.01±0.00</td><td>0.01±0.00</td><td>0.01±0.01</td><td>0.00±0.00</td><td>0.00±0.00</td></tr><tr><td>LL</td><td>Factorized</td><td>NF</td><td>KSD VI</td><td>KIVI</td><td>HMC</td></tr><tr><td>boston</td><td colspan="5">-2.66±0.04 -2.66±0.04 -3.32±0.01 -2.53±0.10 -2.29±0.01</td></tr><tr><td colspan="6">concrete -3.22±0.06 -3.24±0.06 -4.13±0.01 -3.05±0.04 -2.81±0.02</td></tr><tr><td>energy</td><td colspan="5">-2.34±0.02 -2.36±0.03 -3.61±0.00 -1.30±0.01 -1.43±0.01</td></tr><tr><td>kin8nm</td><td>0.96±0.01</td><td colspan="2">1.01±0.01 -0.18±0.01</td><td>1.16±0.01</td><td>1.22±0.01</td></tr><tr><td>naval</td><td>4.00±0.11</td><td>4.04±0.12</td><td>3.28±0.13</td><td>5.50±0.12</td><td>7.31±0.00</td></tr><tr><td colspan="5">example, Rezende &amp; Mohamed (2015) proposed the planar normalizing flow:</td><td/></tr></table>

Peer review (iclr2018):
 Thank you for the feedback, and I think many of my concerns have been addressed. I think the paper should be accepted. ==== original review ==== Thank you for an interesting read. Approximate inference with implicit distribution has been a recent focus of the research since late 2016. I have seen several papers simultaneously proposing the density ratio estimation idea using GAN approach. This paper, although still doing density ratio estimation, uses kernel estimators instead and thus avoids the usage of discriminators. Furthermore, the paper proposed a new type of implicit posterior approximation which uses intuitions from matrix factorisation. I do think that another big challenge that we need to address is the construction of good implicit approximations, which is not well studied in previous literature (although this is a very new topic). This paper provides a good start in this direction. However several points need to be clarified and improved: 1. There are other ways to do implicit posterior inference such as amortising deterministic/stochastic dynamics, and approximating the gradient updates of VI. Please check the literature. 2. For kernel based density ratio estimation methods, you probably need to cite a bunch of Sugiyama papers besides (Kanamori et al. 2009). 3. Why do you need to introduce both regression under p and q (the reverse ratio trick)? I didn*t see if you have comparisons between the two. From my perspective the reverse ratio trick version is naturally more suitable to VI. 4. Do you have any speed and numerical issues on differentiating through alpha (which requires differentiating K^{-1})? 5. For kernel methods, kernel parameters and lambda are key to performances. How did you tune them? 6. For the celebA part, can you compute some quantitative metric, e.g inception score?