{'fraction_non_alphanumeric': 0.03245024717961719, 'fraction_numerical': 0.011535048802129548, 'mean_word_length': 4.763330898466034, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Robust Variational Inference

Variational inference is a powerful tool for approximate inference. However, it mainly focuses on the evidence lower bound as variational objective and the development of other measures for variational inference is a promising area of research. This paper proposes a robust modification of evidence and a lower bound for the evidence, which is applicable when the majority of the training set samples are random noise objects. We provide experiments for variational autoencoders to show advantage of the objective over the evidence lower bound on synthetic datasets obtained by adding uninformative noise objects to MNIST and OMNIGLOT. Additionally, for the original MNIST and OMNIGLOT datasets we observe a small improvement over the non-robust evidence lower bound.


Introduction
One of the common approaches to approximate Bayesian inference, especially popular for large-scale models, is maximization of variational lower bound on the model's evidence. In recent years several new objectives were proposed. Burda et al. (2016) gave a tighter evidence lower bound (ELBO) which exploits multiple samples from the approximating distribution. Li and Turner (2016) extended traditional variational inference with Renyi divergence-inspired evidence bounds. These bounds were shown to be more effective for certain unsupervised learning problems.
In this paper we consider the problem of unsupervised learning for data which is known to contain many uninformative (noise) objects. First, we replace the traditional log-evidence i log p(x i ) with a robust counterpart i log(ε + p(x i )). This function ignores the objects with low evidence p(x i ) ε. Next, we derive a variational lower bound on robust model evidence which also shares the same robustness property. We show that by maximizing this lower bound we can successfully train variational autoencoders even in the scenarios where the noise objects comprise the majority of the training dataset. An alternative approach, proposed by Wang et al. (2016), is to reweight the per-object likelihood terms with additional local latent variables. In future, we plan to compare to this approach.

Robust variational inference
In what follows we consider a parametric latent variable model p(x, z|θ) = p(x|z, θ)p(z) with local latent variables z and parameter θ. We derive a lower bound for the robust evidence and study its properties. Finally, following (Kingma and Welling, 2014), we propose a training procedure for variational autoencoders with the robust evidence lower bound. We start off with the robust log-evidence N i=1 log(ε + p(x i |θ)). First, we rewrite it for each sample: and then apply Jensen's inequality to obtain the robust evidence lower bound L ε (X, θ, φ) The robust evidence bound is tight when the variational distribution q( This objective exhibits robustness to the objects with the low value of p(xi,zi|θ) q(zi|xi,φ) . For a fixed sample Therefore, the stochastic gradient of the robust evidence lower bound has the same direction as the gradient of the non-regularized ELBO L for this sample (x i , z i ): When p(xi,zi|θ) q(zi|xi,φ) ε, the scalar factor before this gradient is close to zero and the sample does not contribute to the parameter update. On the other hand, when p(xi,zi|θ) q(zi|xi,φ) > ε, the factor lies in [ 1 2 , 1) and we obtain almost the same update as for the non-regularized ELBO.
To benefit from the robustness one has to choose ε carefully. Underestimating ε results in poor regularization, overestimating ε results in significant distortion of the evidence. It is natural choose ε value to be comparable to the log-likelihood of the dataset. We propose to use a dynamically changing value for ε, specifically a multiple of the mean evidence lower bound: Here α > 0 controls the regularization effect. As α → 0 the robust evidence lower bound converges to ELBO.

Training procedure
To train the model, a stochastic gradient based optimizer is used to maximize the objective function. We use Gaussian latent variables and employ reparametrization trick to obtain the gradient estimates. Firstly, we train the model for one epoch with the evidence lower bound as an objective and initialize log ε as the mean ELBO value at the first epoch. Secondly, we fix log α and then train the model using the robust evidence lower bound as an objective. After each gradient step we update log ε with the mean ELBO of the previous batch using exponential smoothing. Moreover, after each epoch we update log ε with the mean ELBO from the previous epoch. The proportion of (original:noise) data points is varied from 2:1 to 1:2. We compared test log-likelihood of the original dataset for variational autoencoders (VAE) and the proposed robust autoencoders (rVAE) with different regularization parameters α (note that the x-axis is not uniform). rVAE successfully ignores the noise data points while VAE's quality degrades significantly.

Experiments
In our experiments we used a model with the following architecture: fully-connected encoder and decoder had two hidden layers with 200 units, stochastic layer had 50 hidden units. Parametric ReLU (He et al., 2015) activation units were used for the deterministic layers.
We used Adam (Kingma and Ba (2015)) with parameters β 1 = 0.99, β 2 = 0.999, = 10 −4 for objective maximization. Each model was trained for 1000 epochs with a fixed learning rate of 10 −3 . Batch size was set to 200. The following rule was used to update ε after processing of each batch: log ε new = 0.99 log ε old + 0.01 log ε, where ε is estimated using eqn. (5).
In the first experiment we compared the robust variational autoencoders with autoencoders on two synthetic datasets. We used MNIST and OMNIGLOT (Lake et al., 2015) as real-world base sets, and then added uninformative data points, i.e. 28 * 28 images with each pixel's intensity equal to the mean pixel intensity of the original dataset. Due to dynamic binarization (Burda et al., 2016) these data points act as noise. We varied the relation of the number of the original data points to the number of noise data points from 2:1 to 1:2.
To evaluate the models performance we computed mean log-likelihood estimate over 200 samples on MNIST and OMNIGLOT test sets (without any noise). The range of log α was selected empirically: we started with log α = −50 and then increased it to find the optimal value with respect to the test likelihood.
Results of the first experiment are shown in Figure 1. The robust autoencoder managed to fit the data despite noise. At the same time, VAEs test log-likelihood significantly decreased as the fraction of noise increased. The optimal value of α depends on base dataset and fraction of noise. For example, for OMNIGLOT the best log α increased monotonically with the fraction of noise. However, for MNIST there was no such simple pattern.
In the second experiment we have compared rVAEs and VAEs on datasets without synthetic noise. We used the same network architecture and optimization approach. Test log-likelihoods for MNIST and OMNIGLOT datasets are presented in Figure 2. In this setting the best results were achieved when α almost coincided with zero. We observed a small improvement of the robust autoencoder over the variational autoencoder, suggesting that robust VAE provides a beneficial regularization effect.

Conclusion
We presented a new variational objective for approximate inference and showed its advantage in the training setting where noisy objects comprise the majority of a dataset. Additionally, the proposed robust variational objective provides small regularization effect on datasets without any artificial noise. In future we plan to incorporate the regularization parameter into the probabilistic model, design a procedure for automatic selection of the parameter and evaluate the model on a real-world noisy dataset.