VAE with a VampPrior

Jakub M. Tomczak, Max Welling

Introduction

Learning generative models that are capable of capturing rich distributions from vast amounts of data like image collections remains one of the major challenges of machine learning. In recent years, different approaches to achieving this goal were proposed by formulating alternative training objectives to the log-likelihood or by utilizing variational inference . The latter approach could be made especially efficient through the application of the reparameterization trick resulting in a highly scalable framework now known as the variational auto-encoders (VAE) . Various extensions to deep generative models have been proposed that aim to enrich the variational posterior . Recently, it has been noticed that in fact the prior plays a crucial role in mediating between the generative decoder and the variational encoder. Choosing a too simplistic prior like the standard normal distribution could lead to over-regularization and, as a consequence, very poor hidden representations .

In this paper, we take a closer look at the regularization term of the variational lower bound inspired by the analysis presented in . Re-formulating the variational lower bound gives two regularization terms: the average entropy of the variational posterior, and the cross-entropy between the averaged (over the training data) variational posterior and the prior. The cross-entropy term can be minimized by setting the prior equal to the average of the variational posteriors over training points. However, this would be computationally very expensive. Instead, we propose a new prior that is a variational mixture of posteriors prior, or VampPrior for short. Moreover, we present a new two-level VAE that combined with our new prior can learn a very powerful hidden representation.

The contribution of the paper is threefold:

We follow the line of research of improving the VAE by making the prior more flexible. We propose a new prior that is a mixture of variational posteriors conditioned on learnable pseudo-data. This allows the variational posterior to learn more a potent latent representation.

We propose a new two-layered generative VAE model with two layers of stochastic latent variables based on the VampPrior idea. This architecture effectively avoids the problems of unused latent dimensions.

We show empirically that the VampPrior always outperforms the standard normal prior in different VAE architectures and that the hierarchical VampPrior based VAE achieves state-of-the-art or comparable to SOTA results on six datasets.

Variational Auto-Encoder

where q(x)=1Nn=1Nδ(xxn)q(\mathbf{x})=\frac{1}{N}\sum_{n=1}^{N}\delta(\mathbf{x}-\mathbf{x}_{n}) is the empirical distribution, qϕ(zx)q_{\phi}(\mathbf{z}|\mathbf{x}) is the variational posterior (the encoder), pθ(xz)p_{\theta}(\mathbf{x}|\mathbf{z}) is the generative model (the decoder) and pλ(z)p_{\lambda}(\mathbf{z}) is the prior, and ϕ,θ,λ\phi,\theta,\lambda are their parameters, respectively.

There are various ways of optimizing this lower bound but for continuous z\mathbf{z} this could be done efficiently through the re-parameterization of qϕ(zx)q_{\phi}(\mathbf{z}|\mathbf{x}) , which yields a variational auto-encoder architecture (VAE). Therefore, during learning we consider a Monte Carlo estimate of the second expectation in (2) using LL sample points:

where zϕ(l)\mathbf{z}_{\phi}^{(l)} are sampled from qϕ(zx)q_{\phi}(\mathbf{z}|\mathbf{x}) through the re-parameterization trick.

The first component of the objective function can be seen as the expectation of the negative reconstruction error that forces the hidden representation for each data case to be peaked at its specific MAP value. On the contrary, the second and third components constitute a kind of regularization that drives the encoder to match the prior.

We can get more insight into the role of the prior by inspecting the gradient of L~(ϕ,θ,λ)\widetilde{\mathcal{L}}(\phi,\theta,\lambda) in (2) and (3) with respect to a single weight ϕi\phi_{i} for a single data point x\mathbf{x}, see Eq. (17) and (18) in Supplementary Material for details. We notice that the prior plays a role of an ”anchor” that keeps the posterior close to it, i.e., the term in round brackets in Eq. (18) is if the posterior matches the prior.

The Variational Mixture of Posteriors Prior

The variational lower-bound consists of two parts, namely, the reconstruction error and the regularization term between the encoder and the prior. However, we can re-write the training objective (2) to obtain two regularization terms instead of one :

Usually, the prior is chosen in advance, e.g., a standard normal prior. However, one could find a prior that optimizes the ELBO by maximizing the following Lagrange function with the Lagrange multiplier β\beta:

The solution of this problem is simply the aggregated posterior:

However, this choice may potentially lead to overfitting and definitely optimizing the recognition model would become very expensive due to the sum over all training points. On the other hand, having a simple prior like the standard normal distribution is known to result in over-regularized models with only few active latent dimensions .

In order to overcome issues like overfitting, over-regularization and high computational complexity, the optimal solution, i.e., the aggregated posterior, can be further approximated by a mixture of variational posteriors with pseudo-inputs:

where KK is the number of pseudo-inputs, and uk\mathbf{u}_{k} is a DD-dimensional vector we refer to as a pseudo-input. The pseudo-inputs are learned through backpropagation and can be thought of as hyperparameters of the prior, alongside parameters of the posterior ϕ\phi, λ={u1,,uK,ϕ}\lambda=\{\mathbf{u}_{1},\ldots,\mathbf{u}_{K},\phi\}. Importantly, the resulting prior is multimodal, thus, it prevents the variational posterior to be over-regularized. On the other hand, incorporating pseudo-inputs prevents from potential overfitting once we pick KNK\ll N, which also makes the model less expensive to train. We refer to this prior as the variational mixture of posteriors prior (VampPrior).

In the case of the VampPrior, on the other hand, we obtain two advantages over the MoG prior:

First, by coupling the prior with the posterior we entertain fewer parameters and the prior and variational posteriors will at all times “cooperate” during training.

Second, this coupling highly influences the gradient wrt a single weight of the encoder, ϕi\phi_{i}, for a given x\mathbf{x}, see Eq. (20) and (21) in Supplementary Material for details. The differences in (20) and (21) are close to as long as qϕ(zϕ(l)x)qϕ(zϕ(l)uk)q_{\phi}(\mathbf{z}_{\phi}^{(l)}|\mathbf{x})\approx q_{\phi}(\mathbf{z}_{\phi}^{(l)}|\mathbf{u}_{k}). Thus, the gradient is influenced by pseudo-inputs that are dissimilar to x\mathbf{x}, i.e., if the posterior produces different hidden representations for uk\mathbf{u}_{k} and x\mathbf{x}. In other words, since this has to hold for every training case, the gradient points towards a solution where the variational posterior has high variance. On the contrary, the first part of the objective in (19) causes the posteriors to have low variance and map to different latent explanations for each data case. These effects distinguish the VampPrior from the MoG prior utilized in the VAE so far .

The idea of the Empirical Bayes (EB), also known as the type-II maximum likelihood, is to find hyperparameters λ\lambda of the prior over latent variables z\mathbf{z}, p(zλ)p(\mathbf{z}|\lambda), by maximizing the marginal likelihood p(xλ)p(\mathbf{x}|\lambda). In the case of the VAE and the VampPrior the pseudo-inputs, alongside the parameters of the posterior, are the hyperparameters of the prior and we aim at maximizing the ELBO with respect to them. Thus, our approach is closely related to the EB and in fact it formulates a new kind of Bayesian inference that combines the variational inference with the EB approach.

We have shown that the aggregated posterior is the optimal prior within the VAE formulation. This result is closely related to the Information Bottleneck (IB) approach where the aggregated posterior naturally plays the role of the prior. Interestingly, the VampPrior brings the VAE and the IB formulations together and highlights their close relation. A similar conclusion and a more thorough analysis of the close relation between the VAE and the IB through the VampPrior is presented in .

Hierarchical VampPrior Variational Auto-Encoder

A typical problem encountered during training a VAE is the inactive stochastic units . Our VampPrior VAE seems to be an effective remedy against this issue, simply because the prior is designed to be rich and multimodal, preventing the KL term from pulling individual posteriors towards a simple (e.g., standard normal) prior. The inactive stochastic units problem is even worse for learning deeper VAEs (i.e., with multiple layers of stochastic units). The reason might be that stochastic dependencies within a deep generative model are top-down in the generative process and bottom-up in the variational process. As a result, there is less information obtained from real data at the deeper stochastic layers, making them more prone to become regularized towards the prior.

In order to prevent a deep generative model to suffer from the inactive stochastic units problem we propose a new two-layered VAE as follows:

while the the generative part is the following:

with p(z2)p(\mathbf{z}_{2}) given by a VampPrior. The model is depicted in Figure 1(b).

We have motivated the VampPrior by analyzing the variational lower bound. However, one could inquire whether we really need such complicated prior and maybe the proposed two-layered VAE is already sufficiently powerful. In order to answer these questions we further verify three alternative priors:

the VampPrior with a random subset of real training data as non-trainable pseudo-inputs (VampPrior data).

Including the standard prior can provide us with an answer to the general question if there is even a need for complex priors. Utilizing the mixture of Gaussians verifies whether it is beneficial to couple the prior with the variational posterior or not. Finally, using a subset of real training images determines to what extent it is useful to introduce trainable pseudo-inputs.

Experiments

In the experiments we aim at: (i) verifying empirically whether the VampPrior helps the VAE to train a representation that better reflects variations in data, and (ii) inspecting if our proposition of a two-level generative model performs better than the one-layered model. In order to answer these questions we compare different models parameterized by feed-forward neural networks (MLPs) or convolutional networks that utilize the standard prior and the VampPrior. In order to compare the hierarchical VampPrior VAE with the state-of-the-art approaches, we used also an autoregressive decoder. Nevertheless, our primary goal is to quantitatively and qualitatively assess the newly proposed prior.

We carry out experiments using six image datasets: static MNIST , dynamic MNIST , OMNIGLOT , Caltech 101 Silhouette , Frey Faceshttp://www.cs.nyu.edu/~roweis/data/frey_rawface.mat and Histopathology patches . More details about the datasets can be found in the Supplementary Material.

In the experiments we modeled all distributions using MLPs with two hidden layers of 300300 hidden units in the unsupervised permutation invariant setting. We utilized the gating mechanism as an element-wise non-linearity . We utilized 4040 stochastic hidden units for both z1\mathbf{z}_{1} and z2\mathbf{z}_{2}. Next we replaced MLPs with convolutional layers with gating mechanism. Eventually, we verified also a PixelCNN as the decoder. For Frey Faces and Histopathology we used the discretized logistic distribution of images as in , and for other datasets we applied the Bernoulli distribution.

For learning the ADAM algorithm with normalized gradients was utilized with the learning rate in {104,5104}\{10^{-4},5\cdot 10^{-4}\} and mini-batches of size 100100. Additionally, to boost the generative capabilities of the decoder, we used the warm-up for 100100 epochs . The weights of the neural networks were initialized according to . The early-stopping with a look ahead of 5050 iterations was applied. For the VampPrior we used 500500 pseudo-inputs for all datasets except OMNIGLOT for which we utilized 10001000 pseudo-inputs. For the VampPrior data we randomly picked training images instead of the learnable pseudo-inputs.

We denote the hierarchical VAE proposed in this paper with MLPs by HVAE, while the hierarchical VAE with convolutional layers and additionally with a PixelCNN decoder are denoted by convHVAE and PixelHVAE, respectively.

2 Results

We quantitatively evaluate our method using the test marginal log-likelihood (LL) estimated using the Importance Sampling with 5,000 sample points . In Table 1 we present a comparison between models with the standard prior and the VampPrior. The results of our approach in comparison to the state-of-the-art methods are gathered in Table 2, 3, 4 and 5 for static and dynamic MNIST, OMNIGLOT and Caltech 101 Silhouettes, respectively.

First we notice that in all cases except one the application of the VampPrior results in a substantial improvement of the generative performance in terms of the test LL comparing to the standard normal prior (see Table 1). This confirms our supposition that a combination of multimodality and coupling the prior with the posterior is superior to the standard normal prior. Further, we want to stress out that the VampPrior outperforms other priors like a single Gaussian or a mixture of Gaussians (see Table 2). These results provide an additional evidence that the VampPrior leads to a more powerful latent representation and it differs from the MoG prior. We also examined whether the presented two-layered model performs better than the widely used hierarchical architecture of the VAE. Indeed, the newly proposed approach is more powerful even with the SG prior (HVAE (L=2L=2) + SG) than the standard two-layered VAE (see Table 2). Applying the MoG prior results in an additional boost of performance. This provides evidence for the usefulness of a multimodal prior. The VampPrior data gives only slight improvement comparing to the SG prior and because of the application of the fixed training data as the pseudo-inputs it is less flexible than the MoG. Eventually, coupling the variational posterior with the prior and introducing learnable pseudo-inputs gives the best performance.

Additionally, we compared the VampPrior with the MoG prior and the SoG prior in Figure 2 for varying number of pseudo-inputs/components. Surprisingly, taking more pseudo-inputs does not help to improve the performance and, similarly, considering more mixture components also resulted in drop of the performance. However, again we can notice that the VampPrior is more flexible prior that outperforms the MoG.

An inspection of histograms of the log-likelihoods (see Supplementary Material) shows that the distributions of LL values are heavy-tailed and/or bimodal. A possible explanation for such characteristics of the histograms is the existence of many examples that are relatively simple to represent (first mode) and some really hard examples (heavy-tail). Comparing our approach to the VAE reveals that the VAE with the VampPrior is not only better on average but it produces less examples with high values of LL and more examples with lower LL.

We hypothesized that the VampPrior provides a remedy for the inactive units issue. In order to verify this claim we utilized the statistics introduced in . The results for the HVAE with the VampPrior in comparison to the two-level VAE and IWAE presented in are given in Figure 3. The application of the VampPrior increases the number of active stochastic units four times for the second level and around 1.5 times more for the first level comparing to the VAE and the IWAE. Interestingly, the number of mixture components has a great impact on the number of active stochastic units in the second level. Nevertheless, even one mixture component allows to achieve almost three times more active stochastic units comparing to the vanilla VAE and the IWAE.

In general, an application of the VampPrior improves the performance of the VAE and in the case of two layers of stochastic units it yields the state-of-the-art results on all datasets for models that use MLPs. Moreover, our approach gets closer to the performance of models that utilize convolutional neural networks, such as, the one-layered VAE with the inverse autoregressive flow (IAF) that achieves 79.88-79.88 on static MNIST and 79.10-79.10 on dynamic MNIST, the one-layered Variational Lossy Autoencoder (VLAE) that obtains 79.03-79.03 on static MNIST and 78.53-78.53 on dynamic MNIST, and the hierarchical PixelVAE that gets 78.96-78.96 on dynamic MNIST. On the other two datasets the VLAE performs way better than our approach with MLPs and achieves 89.83-89.83 on OMNIGLOT and 77.36-77.36 on Caltech 101 Silhouettes.

In order to compare our approach to the state-of-the-art convolutional-based VAEs we performed additional experiments using the HVAE (L=2L=2) + VampPrior with convolutional layers in both the encoder and decoder. Next, we replaced the convolutional decoder with the PixelCNN decoder (convHVAE and PixelHVAE in Tables 2–5). For the PixelHVAE we were able to improve the performance to obtain 79.78-79.78 on static MNIST, 78.45-78.45 on dynamic MNIST, 89.76-89.76 on Omniglot, and 86.22-86.22 on Caltech 101 Silhouettes. The results confirmed that the VampPrior combined with a powerful encoder and a flexible decoder performs much better than the MLP-based approach and allows to achieve state-of-the-art performance on dynamic MNIST and OMNIGLOTIn the performance of the VLAE on static MNIST and Caltech 101 Silhouettes is provided for a different training procedure than the one used in this paper..

The biggest disadvantage of the VAE is that it tends to produce blurry images . We noticed this effect in images generated and reconstructed by VAE (see Supplementary Material). Moreover, the standard VAE produced some digits that are hard to interpret, blurry characters and very noisy silhouettes. The supremacy of HVAE + VampPrior is visible not only in LL values but in image generations and reconstructions as well because these are sharper.

We also examine what the pseudo-inputs represent at the end of the training process (see Figure 4). Interestingly, trained pseudo-inputs are prototypical objects (digits, characters, silhouettes). Moreover, images generated for a chosen pseudo-input show that the model encodes a high variety of different features such as shapes, thickness and curvature for a single pseudo-input. This means that the model is not just memorizing the data-cases. It is worth noticing that for small-sample size and/or too flexible decoder the pseudo-inputs can be hard to train and they can represent noisy prototypes (e.g., see pseudo-inputs for Frey Faces in Figure 4).

Related work

The VAE is a latent variable model that is usually trained with a very simple prior, i.e., the standard normal prior. In a Dirichlet process prior using a stick-breaking process was proposed, while proposed a nested Chinese Restaurant Process. These priors enrich the generative capabilities of the VAE, however, they require sophisticated learning methods and tricks to be trained successfully. A different approach is to use an autoregressive prior that applies the IAF to random noise. This approach gives very promising results and allows to build rich representations. Nevertheless, the authors of combine their prior with a convolutional encoder and an autoregressive decoder that makes it harder to assess the real contribution of the autoregressive prior to the generative model.

Clearly, the quality of generated images are dependent on the decoder architecture. One way of improving generative capabilities of the decoder is to use an infinite mixture of probabilistic component analyzers , which is equivalent to a rank-one covariance matrix. A more appealing approach would be to use deep autoregressive density estimators that utilize recurrent neural networks or gated convolutional networks . However, there is a threat that a too flexible decoder could discard hidden representations completely, turning the encoder to be useless .

Concurrently to our work, in a variational VAE with a memory was proposed. This approach shares similarities with the VampPrior in terms of a learnable memory (pseudo-inputs in our case) and a multimodal prior. Nevertheless, there are two main differences. First, our prior is an explicit mixture while they sample components. Second, we showed that the optimal prior requires to be coupled with the variational posterior. In the experiments we showed that the VampPrior improves the generative capabilities of the VAE but in it was noticed that the generative performance is comparable to the standard normal prior. We claim that the success of the VampPrior follows from the utilization of the variational posterior in the prior, a part that is missing in .

Very recently, the VampPrior was shown to be a perfect match for the information-theoretic approach to learn latent representation . Additionally, the authors of proposed to use a weighted version of the VampPrior:

where w1,,wKw_{1},\ldots,w_{K} are trainable parameters such that kwk0\forall_{k}w_{k}\geq 0 and kwk=1\sum_{k}w_{k}=1. This allows the VampPrior to learn which components (i.e, pseudo-inputs) are meaningful and may prevent from potential overfitting.

Conclusion

In this paper, we followed the line of thinking that the prior is a critical element to improve deep generative models, and in particular VAEs. We proposed a new prior that is expressed as a mixture of variational posteriors. In order to limit the capacity of the prior we introduced learnable pseudo-inputs as hyper-parameters of the prior, the number of which can be chosen freely. Further, we formulated a new two-level generative model based on this VampPrior. We showed empirically that applying our prior can indeed increase the performance of the proposed generative model and successfully overcome the problem of inactive stochastic latent variables, which is particularly challenging for generative models with multiple layers of stochastic latent variables. As a result, we achieved state-of-the-art or comparable results to SOTA models on six datasets. Additionally, generations and reconstructions obtained from the hierarchical VampPrior VAE are of better quality than the ones achieved by the standard VAE.

We believe that it is worthwhile to further pursue the line of the research presented in this paper. Here we applied our prior to image data but it would be interesting to see how it behaves on text or sound, where the sequential aspect plays a crucial role. We have already showed that combining the VampPrior VAE with convolutional nets and a powerful autoregressive density estimator is beneficial but more thorough study is needed. Last but not least, it would be interesting to utilize a normalizing flow , the hierarchical variational inference , ladder networks or adversarial training within the VampPrior VAE. However, we leave investigating these issues for future work.

The authors are grateful to Rianne van den Berg, Yingzhen Li, Tim Genewein, Tameem Adel, Ben Poole and Alex Alemi for insightful comments.

The research conducted by Jakub M. Tomczak was funded by the European Commission within the Marie Skłodowska-Curie Individual Fellowship (Grant No. 702666, ”Deep learning and Bayesian inference for medical imaging”).

References

SUPPLEMENTARY MATERIAL

The gradient of L~(ϕ,θ,λ)\widetilde{\mathcal{L}}(\phi,\theta,\lambda) in (2) and (3) for the standard normal prior with respect to a single weight ϕi\phi_{i} for a single data point x\mathbf{x} is the following:

2 The gradient of Eq. 2 and 3 with the VampPrior

The gradient of L~(ϕ,θ,λ)\widetilde{\mathcal{L}}(\phi,\theta,\lambda) in (2) and (3) for the VampPrior with respect to a single weight ϕi\phi_{i} for a single data point x\mathbf{x} is the following:

3 Details on the gradient calculation in Eq. 20 and 21

Let us recall the objective function for single datapoint x\mathbf{x}_{*} using LL Monte Carlo sample points:

We are interested in calculating gradient with respect to a single parameter ϕi\phi_{i}. We can split the gradient into two parts:

Calculating the gradient separately for both ()(*) and ()(**) yields:

For comparison, the gradient of ()(**) for a prior pλ(z)p_{\lambda}(\mathbf{z}) that is independent of the variational posterior is the following:

We notice that in (25) if qϕqϕkq_{\phi}^{*}\approx q_{\phi}^{k} for some kk, then the differences (qϕ ϕiqϕkqϕk ϕiqϕ)(q_{\phi}^{*}\ \frac{\partial}{\partial\phi_{i}}q_{\phi}^{k}-q_{\phi}^{k}\ \frac{\partial}{\partial\phi_{i}}q_{\phi}^{*}) and (qϕ zϕqϕkqϕk zϕqϕ)(q_{\phi}^{*}\ \frac{\partial}{\partial\mathbf{z}_{\phi}}q_{\phi}^{k}-q_{\phi}^{k}\ \frac{\partial}{\partial\mathbf{z}_{\phi}}q_{\phi}^{*}) are close to . Hence, the gradient points into an average of all dissimilar pseudo-inputs contrary to the gradient of the standard normal prior in (26) that pulls always towards 0\mathbf{0}. As a result, the encoder is trained so that to have large variance because it is attracted by all dissimilar points and due to this fact it assigns separate regions in the latent space to each datapoint. This effect should help the decoder to decode a hidden representation to an image much easier.

4 Details on experiments

All experiments were run on NVIDIA TITAN X Pascal. The code for our models is available online at https://github.com/jmtomczak/vae_vampprior.

We carried out experiments using six image datasets: static and dynamic MNISThttp://yann.lecun.com/exdb/mnist/, OMNIGLOTWe used the pre-processed version of this dataset as in : https://github.com/yburda/iwae/blob/master/datasets/OMNIGLOT/chardata.mat. , Caltech 101 SilhouettesWe used the dataset with fixed split into training, validation and test sets: https://people.cs.umass.edu/~marlin/data/caltech101_silhouettes_28_split1.mat. , Frey Faceshttp://www.cs.nyu.edu/~roweis/data/frey_rawface.mat, and Histopathology patches . Frey Faces contains images of size 28×2028\times 20 and all other datasets contain 28×2828\times 28 images. We distinguish between static MNIST with fixed binarizartion of images and dynamic MNIST with dynamic binarization of data during training as in .

MNIST consists of hand-written digits split into 60,000 training datapoints and 10,000 test sample points. In order to perform model selection we put aside 10,000 images from the training set. We distinguish between static MNIST with fixed binarizartion of imageshttps://github.com/yburda/iwae/tree/master/datasets/BinaryMNIST and dynamic MNIST with dynamic binarization of data during training as in .

OMNIGLOT is a dataset containing 1,623 hand-written characters from 50 various alphabets. Each character is represented by about 20 images that makes the problem very challenging. The dataset is split into 24,345 training datapoints and 8,070 test images. We randomly pick 1,345 training examples for validation. During training we applied dynamic binarization of data similarly to dynamic MNIST.

Caltech 101 Silhouettes contains images representing silhouettes of 101 object classes. Each image is a filled, black polygon of an object on a white background. There are 4,100 training images, 2,264 validation datapoints and 2,307 test examples. The dataset is characterized by a small training sample size and many classes that makes the learning problem ambitious.

Frey Faces is a dataset of faces of a one person with different emotional expressions. The dataset consists of nearly 2,000 gray-scaled images. We randomly split them into 1,565 training images, 200200 validation images and 200200 test images. We repeated the experiment 33 times.

Histopathology is a dataset of histopathology patches of ten different biopsies containing cancer or anemia. The dataset consists of gray-scaled images divided into 6,800 training images, 2,000 validation images and 2,000 test images.

4.2 Additional results: Wall-clock times

Using our implementation, we have calculated wall-clock times for K=500K=500 (measured on MNIST) and K=1000K=1000 (measured on OMNIGLOT). HVAE+VampPrior was about 1.4 times slower than the standard normal prior. ConvHVAE and PixelHVAE with the VampPrior resulted in the increased training times, respectively, by a factor of ×1.9\times 1.9/×2.1\times 2.1 and ×1.4\times 1.4/×1.7\times 1.7 (K=500K=500/K=1000K=1000) comparing to the standard prior. We believe that this time burden is acceptable regarding the improved generative performance resulting from the usage of the VampPrior.

4.3 Additional results: Generations, reconstructions and histograms of log-likelihood

The generated images are presented in Figure 5. Images generated by HVAE (L=2L=2) + VampPrior are more realistic and sharper than the ones given by the vanilla VAE. The quality of images generated by convHVAE and PixelHVAE contain much more details and better reflect variations in data.

The reconstructions from test images are presented in Figure 6. At first glance the reconstructions of VAE and HVAE (L=2L=2) + VampPrior look similarly, however, our approach provides more details and the reconstructions are sharper. This is especially visible in the case of OMNIGLOT (middle row in Figure 6) where VAE is incapable to reconstruct small circles while our approach does in most cases. The application of convolutional networks further improves the quality of reconstructions by providing many tiny details. Interestingly, for the PixelHVAE we can notice some "fantasizing" during reconstructing images (e.g., for OMNIGLOT). It means that the decoder was, to some extent, too flexible and disregarded some information included in the latent representation.

The histograms of the log-likelihood per test example are presented in Figure 7. We notice that all histograms characterize a heavy-tail indicating existence of examples that are hard to represent. However, taking a closer look at the histograms for HVAE (L=2L=2) + VampPrior and its convolutional-based version reveals that there are less hard examples comparing to the standard VAE. This effect is especially apparent for the convHVAE.