E NTROPIC GAN S MEET VAE S : A S TATISTICAL A PPROACH TO C OMPUTE S AMPLE L IKELIHOODS IN GAN S
Anonymous authors
Paper under double-blind review
A BSTRACT
Building on the success of deep learning, two modern approaches to learn a probability model of the observed data are Generative Adversarial Networks (GANs) and Variational AutoEncoders (VAEs).
VAEs consider an explicit probability model for the data and compute a generative distribution by maximizing a variational lower-bound on the log-likelihood function.
GANs, however, compute a generative model by minimizing a distance between observed and generated probability distributions without considering an explicit model for the observed data.
The lack of having explicit probability models in GANs prohibits computation of sample likelihoods in their frameworks and limits their use in statistical inference problems.
In this work, we show that an optimal transport GAN with the entropy regularization can be viewed as a generative model that maximizes a lower-bound on average sample likelihoods, an approach that VAEs are based on.
In particular, our proof constructs an explicit probability model for GANs that can be used to compute likelihood statistics within GAN’s framework.
Our numerical results on several datasets demonstrate consistent trends with the proposed theory.
I NTRODUCTION
Learning generative models is becoming an increasingly important problem in machine learning and statistics with a wide range of applications in self-driving cars (Santana & Hotz, 2016), robotics (Hirose et al., 2017), natural language processing (Lee & Tsao, 2018), domain-transfer (Sankaranarayanan et al., 2018), computational biology (Ghahramani et al., 2018), etc.
Two modern approaches to deal with this problem are Generative Adversarial Networks (GANs) (Goodfellow et al., 2014) and Variational AutoEncoders (VAEs) (Kingma & Welling, 2013; Makhzani et al., 2015;
Rosca et al., 2017; Tolstikhin et al., 2017; Mescheder et al., 2017b).
VAEs (Kingma & Welling, 2013) compute a generative model by maximizing a variational lowerbound on average sample likelihoods using an explicit probability distribution for the data.
GANs, however, learn a generative model by minimizing a distance between observed and generated distributions without considering an explicit probability model for the data.
Empirically, GANs have been shown to produce higher-quality generative samples than that of VAEs (Karras et al., 2017).
However, since GANs do not consider an explicit probability model for the data, we are unable to compute sample likelihoods using their generative models.
Computations of sample likelihoods and posterior distributions of latent variables are critical in several statistical inference.
Inability to obtain such statistics within GAN’s framework severely limits their applications in such statistical inference problems.
In this paper, we resolve these issues for a general formulation of GANs by providing a theoreticallyjustiﬁed approach to compute sample likelihoods using GAN’s generative model.
Our results can open new directions to use GANs in massive-data applications such as model selection, sample selection, hypothesis-testing, etc (see more details in Section 5).
Now, we state our main results informally without going into technical conditions while precise statements of our results are presented in Section 2.
Let Y and ˆ Y ∶= G ( X ) represent observed (i.e. real) and generative (i.e. fake or synthetic) variables, respectively.
X (i.e. the latent variable) is the randomness used as the input to the generator G ( . ) .
Consider the following explicit probability generator (G * )
[Figure]
E[log f X (x)] x f X ( x ) likelihood of latent variable y test coupling entropy
P *Y|Y= y test ^ H( )
Y= G*(X) ^ generative variable
E[l(Y=y test , G * (X))] distance to the model
[Figure]
[Equation]
where (cid:96) ( .,. ) is a loss function. f Y ∣ X
= x ( y ) is the model that we are considering for the underlying data distribution.
This is a reasonable model for the data as the function G can be a complex function.
Similar data models have been used in VAEs. Under this explicit probability model, we show that minimizing the objective of an optimal transport GAN (e.g. Wasserstein GAN Arjovsky et al.
with the cost function (cid:96) ( .,. )
and an entropy regularization (Cuturi, 2013; Seguy et al., 2017) maximizes a variational lower-bound on average sample likelihoods.
I.e average sample likelihoods ≥ − ( GAN objective) + constants .
If (cid:96) ( y , ˆ y ) =
∥
y − ˆ y ∥ 2 , the optimal transport (OT) GAN simpliﬁes to WGAN (Arjovsky et al., 2017) while if (cid:96) ( y , ˆ y ) =
∥
y − ˆ y ∥ 22 , the OT GAN simpliﬁes to the quadratic GAN (or, W2GAN) (Feizi et al., 2017).
The precise statement of this result can be found in Theorem 1.
This result provides a statistical justiﬁcation for GAN’s optimization and puts it in par with VAEs whose goal is to maximize a lower bound on sample likelihoods.
We note that the entropy regularization has been proposed primarily to improve computational aspects of GANs (Genevay et al., 2018).
Our results provide an additional statistical justiﬁcation for this regularization term.
Moreover, using GAN’s training, we obtain a coupling between the observed variable Y and the latent variable X .
This coupling provides the conditional distribution of the latent variable
X given an observed sample Y =
y .
The explicit model of equation 1.1 acts similar to the decoder in the VAE framework, while the coupling computed using GANs acts as an encoder .
Connections between GANs and VAEs have been investigated in some of the recent works as well (Hu et al., 2018; Mescheder et al., 2017a).
In Hu et al.
(2018), GANs are interpreted as methods performing variational inference on a generative model in the label space.
In their framework, observed data samples are treated as latent variables while the generative variable is the indicator of whether data is real or fake.
The method in Mescheder et al. (2017a), on the other hand, uses an auxiliary discriminator network to rephrase the maximum-likelihood objective of a VAE as a twoplayer game similar to the objective of a GAN. Our method is different from both these approaches as we consider an explicit probability model for the data, and show that the entropic GAN objective maximizes a variational lower bound under this probability model, thus allowing sample likelihood computation in GANs similar to VAEs. Of relevance to our work is Wu et al. (2016), in which annealed importance sampling (AIS) is used to evaluate the approximate likelihood of decoder-based generative models.
More speciﬁcally, a
Gaussian observation model with a ﬁxed variance is used as the generative distribution for GANbased models on which the AIS is computed.
Gaussian observation models may not be proper specially in high-dimensional spaces.
Our approach, on the other hand, makes a connection between
GANs and VAEs by constructing a theoretically-motivated model for the data distribution in GANs. We then leverage this approach in computing sample likelihood estimates in GANs. Another key question that we address here is how to estimate the likelihood of a new sample y test given the generative model trained using GANs. For instance, if we train a GAN on stop-sign images, upon receiving a new image, one may wish to compute the likelihood of the new sample y test according to the trained generative model.
In standard GAN formulations, the support of the generative distribution lies on the range of the optimal generator function.
Thus, if the observed sample y test does not lie on that range (which is very likely in practice), there is no way to assign a sensible likelihood score to that sample.
Below, we show that using the explicit probability model of equation 1.1, we can lower-bound the likelihood of this sample y test .
This is similar to the variational lower-bound on sample likelihoods used in VAEs.
Our numerical results show that this lower-bound well-reﬂect the expected trends of the true sample likelihoods.
Let G ∗ and P ∗ Y,X be the optimal generator and the optimal coupling between real and latent variables, respectively.
The optimal coupling P ∗ Y,X can be computed efﬁciently for entropic GANs as we explain in Section 3.
For other GAN architectures, one may approximate such couplings as we explain in Section 4.
The log likelihood of a new test sample y test can be lower-bounded as log f Y ( y test ) ·„„„„„„„„„„„„„„„„„„„„„„„„„„„„‚„„„„„„„„„„„„„„„„„„„„„„„„„„„¶ [Table] [Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
We present the precise statement of this result in Corollary 2.
This result combines three components in order to approximate the likelihood of a sample given a trained generative model:
• The distance between y test to the generative model. If this distance is large, the likelihood of observing y test from the generative model is small
• The entropy of the coupled latent variable. If the entropy term is large, the coupled latent variable has a large randomness. This contributes positively to the sample likelihood.
• The likelihood of the coupled latent variable. If latent samples have large likelihoods, the likelihood of the observed test sample will be large as well.
Figure 2a provides a pictorial illustration of these components.
In what follows, we explain the technical ingredients of our main results.
In Section 3, we present computational methods for GANs and entropic GANs, while in Section 4, we provide numerical experiments on benchmark datasets.
M AIN R ESULTS
Let Y ∈ R
d represent the real-data random variable with a probability density function f Y ( y ) .
GAN’s goal is to ﬁnd a generator function G ∶ R r
→ R d such that ˆ Y ∶= G ( X ) has a similar distribution to Y .
Let X be an r -dimensional random variable with a ﬁxed probability density function f X ( x ) .
Here, we assume f X ( . ) is the density of a normal distribution.
In practice, we observe m samples { y 1 ,..., y m } from Y and generate m ′ samples from ˆ Y , i.e., { ˆ y 1 ,..., ˆ y m ′ } where ˆ y i
=
G ( x i ) for 1 ≤ i ≤ m .
We represent these empirical distributions by P Y and P ˆ Y , respectively.
Note that the number of generative samples m ′ can be arbitrarily large.
GAN computes the optimal generator G ∗ by minimizing a distance between the observed distribution P Y and the generative one P ˆ Y .
Common distance measures include optimal transport measures (e.g. Wasserstein GAN (Arjovsky et al., 2017), WGAN+Gradient Penalty (Gulrajani et al., 2017),
GAN+Spectral Normalization (Miyato et al., 2018), WGAN+Truncated Gradient Penalty (Petzka et al., 2017), relaxed WGAN (Guo et al., 2017)), and divergence measures (e.g. the original GAN’s formulation (Goodfellow et al., 2014),
f -GAN (Nowozin et al., 2016)), etc.
In this paper, we focus on GANs based on optimal transport (OT) distance (Villani, 2008; Arjovsky et al., 2017) deﬁned for a general loss function (cid:96) ( .,. )
as follows
[Equation]
[Equation] P Y, ˆ Y is the joint distribution whose marginal distributions are equal to P Y and P ˆ Y , respectively.
If (cid:96) ( y , ˆ y ) =
∥
y − ˆ y ∥ 2 , this distance is called the ﬁrst-order Wasserstein distance and is referred to by W 1 ( .,. ) , while if (cid:96) ( y , ˆ y ) =
∥
y − ˆ y ∥ 22 , this measure is referred to by W 2 ( .,. )
where W 2 is the second-order Wasserstein distance (Villani, 2008).
The optimal transport (OT) GAN is formulated using the following optimization (Arjovsky et al., 2017; Villani, 2008):
[Equation]
2) where G is the set of generator functions.
Examples of the OT GAN are WGAN (Arjovsky et al., 2017) corresponding to the ﬁrst-order Wasserstein distance W 1 ( .,. )
1 and the quadratic GAN (or, the W2GAN) (Feizi et al., 2017) corresponding to the second-order Wasserstein distance W 2 ( .,. ) .
Note that optimization 2.2 is a min-min optimization.
The objective of this optimization is not smooth in G and it is often computationally expensive to obtain a solution (Sanjabi et al., 2018).
One approach to improve computational aspects of this optimization is to add a regularization term to make its objective strongly convex (Cuturi, 2013; Seguy et al., 2017).
The Shannon entropy function is deﬁned as H ( P Y, ˆ Y ) ∶=
− E [ log P Y, ˆ Y ] .
The negative Shannon entropy is a common strongly-convex regularization term.
This leads to the following optimal transport GAN formulation with the entropy regularization, or for simplicity, the entropic GAN formulation:
[Equation]
where λ is the regularization parameter.
There are two approaches to solve the optimization problem 2.3.
The ﬁrst approach uses an iterative method to solve the min-min formulation (Genevay et al., 2017).
Another approach is to solve an equivelent min-max formulation by writing the dual of the inner minimization (Seguy et al., 2017; Sanjabi et al., 2018).
The latter is often referred to as a GAN formulation since the min-max optimization is over a set of generator functions and a set of discriminator functions.
The details of this approach are further explained in Section 3.
In the following, we present an explicit probability model for entropic GANs under which their objective can be viewed as maximizing a lower bound on average sample likelihoods.
Theorem 1 Let the loss function be shift invariant, i.e.,
[Equation] y − ˆ y ) .
Let
[Equation]
be an explicit probability model for Y given X = x for a well-deﬁned normalization
[Equation]
Then, we have
[Equation]
[Table]
[Equation]
[Table]
+ constants. In words, the entropic GAN maximizes a lower bound on sample likelihoods according to the explicit probability model of equation 2.4.
The proof of this theorem is presented in Section A.
This result has a similar ﬂavor to that of VAEs (Makhzani et al., 2015; Rosca et al., 2017;
Tolstikhin et al., 2017; Mescheder et al., 2017b) where a generative model is computed by maximizing a lower bound on sample likelihoods.
Having a shift invariant loss function is critical for Theorem 1 as this makes the normalization term
C independent from G and x (to see this, one can deﬁne y ′ ∶=
y − G ( x ) in equation 2.6).
The most standard OT GAN loss functions such as the L 2 for WGAN (Arjovsky et al., 2017) and the quadratic loss for W2GAN (Feizi et al., 2017) satisfy this property.
One can further simplify this result by considering speciﬁc loss functions.
For example, we have the following result for the entropic GAN with the quadratic loss function.
Corollary 1 Let (cid:96) ( y , ˆ y ) =
∥
y − ˆ y ∥ 2 / 2 .
Then, f Y ∣ X
= x ( . ) of equation 2.4 corresponds to the multivariate Gaussian density function and C = 1 √ ( 2 πλ ) d .
In this case, the constant term in equation 2. is equal to − log ( m ) − d log ( 2 πλ [Equation]
/ 2 − r / 2 − log ( 2 π )/ 2 .
Let G ∗ and P ∗ Y,X be optimal solutions of an entropic GAN optimization 2.3 (note that the optimal coupling can be computed efﬁciently using equation 3.7).
Let y test be a newly observed sample.
An important question is what the likelihood of this sample is given the trained generative model.
Using the explicit probability model of equation 2.4 and the result of Theorem 1, we can (approximately) compute sample likelihoods as explained in the following corollary.
Corollary 2 Let G ∗ and P ∗ Y, ˆ Y (or, alternatively P ∗ Y,X ) be optimal solutions of the entropic GAN equation 2.3.
Let y test be a new observed sample.
We have
[Equation]
The inequality becomes tight iff D KL ( P ∗ X ∣ Y
=
y test ∣∣ f
X ∣ Y
=
y test )
= 0 where D KL ( . ∣∣ . ) is the KullbackLeibler divergence between two distributions.
GAN’ S D UAL F ORMULATION
In this section, we discuss dual formulations for OT GAN (equation 2.2) and entropic GAN (equation 2.3) optimizations.
These dual formulations are min-max optimizations over two function classes, namely the generator and the discriminator.
Often local search methods such as alternating gradient descent (GD) are used to compute a solution for these min-max optimizations.
First, we discuss the dual formulation of OT GAN optimization 2.2.
Using the duality of the inner minimization, which is a linear program, we can re-write optimization 2.2 as follows (Villani, 2008):
[Equation]
where D 1 ( y ) − D 2 ( ˆ y ) ≤ (cid:96) ( y , ˆ y ) for all ( y , ˆ y ) .
The maximization is over two sets of functions Dand D 2 which are coupled using the loss function.
Using the Kantorovich duality Villani (2008), we can further simplify this optimization as follows:
[Equation]
where D ( (cid:96) )
( ˆ Y ) ∶= inf Y (cid:96) ( Y, ˆ Y )
+ D ( Y ) is the (cid:96) -conjugate function of D ( . )
and D is restricted to (cid:96) -convex functions (Villani, 2008).
The above optimization provides a general formulation for
OT GANs.
If the loss function is ∥ .
∥ 2 , then the optimal transport distance is referred to as the ﬁrst order Wasserstein distance.
In this case, the min-max optimization 3.2 simpliﬁes to the following optimization (Arjovsky et al., 2017):
[Equation]
This is often referred to as Wasserstein GAN, or WGAN (Arjovsky et al., 2017).
If the loss function is quadratic, then the OT GAN is referred to as the quadratic GAN (or, W2GAN) (Feizi et al., 2017).
Similarly, the dual formulation of the entropic GAN equation 2.3 can be written as the following optimization (Cuturi, 2013; Seguy et al., 2017) 2 :
[Equation]
where
[Equation]
Note that the hard constraint of optimization 3.1 is being replaced by a soft constraint in optimization 3.2.
In this case, optimal primal variables P ∗ Y, ˆ Y can be computed according to the following lemma (Seguy et al., 2017):
Lemma 1 Let D ∗ 1 and D ∗ 2 be the optimal discriminator functions for a given generator function G according to optimization 3.4.
Let
[Equation]
Then,
[Equation]
This lemma is important for our results since it provides an efﬁcient way to compute the optimal coupling between real and generative variables (i.e. P ∗ Y, ˆ Y ) using the optimal generator ( G ∗ ) and discriminators ( D ∗ 1 and D ∗ 2 ) of optimization 3.4.
It is worth noting that without the entropy regularization term, computing the optimal coupling using the optimal generator and discriminator functions is not straightforward in general (unless in some special cases such as W2GAN (Villani, 2008; Feizi et al., 2017)).
This is another additional computational beneﬁt of using entropic GAN.
E XPERIMENTAL R ESULTS
In this section, we supplement our theoretical results with experimental validations.
One of the main objectives of our work is to provide a framework to compute sample likelihoods in GANs.
Such likelihood statistics can then be used in several statistical inference applications that we discuss in
Section 5.
With a trained entropic WGAN, the likelihood of a test sample can be lower-bounded using Corollary 2.
Note that this likelihood estimate requires the discriminators D 1 and D 2 to be solved to optimality.
In our implementation, we use the algorithm presented in Sanjabi et al.
(2018) to train the Entropic GAN.
It has been proven (Sanjabi et al., 2018) that this algorithm leads to a good approximation of stationary solutions of Entropic GAN.
To obtain the surrogate likelihood estimates using Corollary 2, we need to compute the density
P ∗ X ∣ Y = y test ( x ) . As shown in Lemma 1, WGAN with entropy regularization provides a closedform solution to the conditional density of the latent variable (equation 3.7).
When G ∗ is injective, P ∗ X ∣ Y = y test ( x ) can be obtained from equation 3.7 by change of variables. In general case, P ∗ X ∣ Y =
y test ( x ) is not well deﬁned as multiple x can produce the same y test .
In this case,
[Equation]
Also, from equation 3.7, we have [Equation] One solution (which may not be unique) that satisﬁes both equation 4.1 and 4.2 is
[Equation]
Ideally, we would like to choose P ∗ X ∣ Y = y test ( x ) satisfying equation 4.1 and 4.2 that maximizes the lower bound of Corollary 2.
But ﬁnding such a solution can be difﬁcult in general.
Instead we use equation 4.3 to evaluate the surrogate likelihoods of Corollary 2 (note that our results still hold in this case).
In order to compute our proposed surrogate likelihood, we need to draw samples from the distribution P ∗ X ∣ Y =
y test ( x ) .
One approach is to use a Markov chain Monte Carlo (MCMC) method to sample from this distribution.
In our experiments, however, we found that MCMC demonstrates poor performance owing to the high dimensional nature of X .
A similar issue with MCMC has been reported for VAEs in Kingma & Welling (2013).
Thus, we use a different estimator to compute the likelihood surrogate which provides a better exploration of the latent space.
We present our sampling procedure in Alg. 1 of Appendix. [Figure]
4. L IKELIHOOD E VOLUTION IN GAN’ S T RAINING
In the experiments of this section, we study how sample likelihoods vary during GAN’s training.
An entropic WGAN is ﬁrst trained on MNIST dataset.
Then, we randomly choose 1 , 000 samples from MNIST test-set to compute the surrogate likelihoods using Algorithm 1 at different training iterations.
Surrogate likelihood computation requires solving D 1 and D 2 to optimality for a given
G (refer to Lemma. 2), which might not be satisﬁed at the intermediate iterations of the training process.
Therefore, before computing the surrogate likelihoods, discriminators D 1 and D 2 are updated for 100 steps for a ﬁxed G .
We expect sample likelihoods to increase over training iterations as the quality of the generative model improves.
Fig.
2a demonstrates the evolution of sample likelihood distributions at different training iterations of the entropic WGAN.
At iteration 1 , surrogate likelihood values are very low as GAN’s generated images are merely random noise.
The likelihood distribution shifts towards high values during the training and saturates beyond a point.
Details of this experiment are presented in Appendix E.
4. L IKELIHOOD C OMPARISON A CROSS DIFFERENT DATASETS
In this section, we perform experiments across different datasets.
An entropic WGAN is ﬁrst trained on a subset of samples from the MNIST dataset containing digit 1 (which we call the MNISTdataset).
With this trained model, likelihood estimates are computed for (1) samples from the entire MNIST dataset, and (2) samples from the Street View House Numbers (SVHN) dataset (Netzer et al., 2011)
(Fig. 2b).
In each experiment, the likelihood estimates are computed for 1000 samples. We note that highest likelihood estimates are obtained for samples from MNIST-1 dataset, the same dataset on which the GAN was trained.
The likelihood distribution for the MNIST dataset is bimodal with one mode peaking inline with the MNIST-1 mode.
Samples from this mode correspond to digit 1 in the MNIST dataset.
The other mode, which is the dominant one, contains the rest of the digits and has relatively low likelihood estimates.
The SVHN dataset, on the other hand, has much smaller likelihoods as its distribution is signiﬁcantly different than that of MNIST.
Furthermore, we observe that the likelihood distribution of SVHN samples has a large spread (variance).
This is because samples of the SVHN dataset is more diverse with varying backgrounds and styles than samples from MNIST.
We note that SVHN samples with high likelihood estimates correspond to images that are similar to MNIST digits, while samples with low scores are different than MNIST samples.
Details of this experiment are presented in Appendix E.
4. A PPROXIMATE L IKELIHOOD C OMPUTATION IN U N - REGULARIZED GAN S
Most standard GAN architectures do not have the entropy regularization.
Likelihood lower bounds of Theorem 1 and Corollary 2 hold even for those GANs as long as we obtain the optimal coupling P ∗ Y, ˆ Y in addition to the optimal generator G ∗ from GAN’s training.
Computation of optimal cou- [Figure] pling P ∗ Y, ˆ Y from the dual formulation of OT GAN can be done when the loss function is quadratic (Feizi et al., 2017).
In this case, the gradient of the optimal discriminator provides the optimal coupling between Y and ˆ Y (Villani, 2008)
(see Lemma.
2 in Appendix C).
For a general GAN architecture, however, the exact computation of optimal coupling P ∗ Y, ˆ Y may be difﬁcult.
One sensible approximation is to couple Y =
y test with a single latent sample ˜ x
(we are assuming the conditional distribution P ∗ X ∣ Y =
y test is an impulse function).
To compute ˜ x corresponding to a y test , we sample k latent samples { x ′ i } ki = 1 and select the x ′ i whose G ∗ ( x ′ i ) is closest to y test .
This heuristic takes into account both the likelihood of the latent variable as well as the distance between y test and the model (similarly to equation 3.7).
We can then use Corollary 2 to approximate sample likelihoods for various GAN architectures.
We use this approach to compute likelihood estimates for CIFAR-10 (Krizhevsky, 2009) and LSUNBedrooms (Yu et al., 2015) datasets.
For CIFAR-10, we train DCGAN while for LSUN, we train WGAN (details of these experiments can be found in Appendix E).
Fig.
3a demonstrates sample likelihood estimates of different datasets using a GAN trained on CIFAR-10.
Likelihoods assigned to samples from MNIST and Ofﬁce datasets are lower than that of the CIFAR dataset.
Samples from the Ofﬁce dataset, however, are assigned to higher likelihood values than MNIST samples.
We note that the Ofﬁce dataset is indeed more similar to the CIFAR dataset than MNIST.
A similar experiment has been repeated for LSUN-Bedrooms (Yu et al., 2015) dataset.
We observe similar performance trends in this experiment (Fig. 3b).
C ONCLUSION
In this paper, we have provided a statistical framework for a family of GANs.
Our main result shows that the entropic GAN optimization can be viewed as maximization of a variational lower-bound on average log-likelihoods, an approach that VAEs are based upon.
This result makes a connection between two most-popular generative models, namely GANs and VAEs.
More importantly, our result constructs an explicit probability model for GANs that can be used to compute a lower-bound on sample likelihoods.
Our experimental results on various datasets demonstrate that this likelihood surrogate can be a good approximation of the true likelihood function.
Although in this paper we mainly focus on understanding the behavior of the sample likelihood surrogate in different datasets, the proposed statistical framework of GANs can be used in various statistical inference applications.
For example, our proposed likelihood surrogate can be used as a quantitative measure to evaluate the performance of different GAN architectures, it can be used to quantify the domain shifts, it can be used to select a proper generator class by balancing the bias term vs. variance, it can be used to detect outlier samples, it can be used in statistical tests such as hypothesis testing, etc.
We leave exploring these directions for future work.
A PPENDIX A P ROOF OF T HEOREM
Using the Baye’s rule one can compute the log -likelihood of an observed sample y as follows:
[Equation]
where the second step follows from equation 2.4.
Consider a joint density function P X,Y such that its marginal distributions match P X and P Y .
Note that the equation A.1 is true for every x .
Thus, we can take the expectation of both sides with respect to a distribution P X ∣ Y =
y .
This leads to the following equation:
[Equation]
where H ( . ) is the Shannon-entropy function [Equation]
Next we take the expectation of both sides with respect to P Y :
[Equation]
Here, we replaced the expectation over P X with the expectation over f X since one can generate an arbitrarily large number of samples from the generator.
Since the KL divergence is always nonnegative, we have
[Equation] Moreover, using the data processing inequality, we have H ( P X,Y ) ≥ H ( P G ( X ) ,Y ) (Cover & Thomas, 2012). Thus, E [ log f Y ( Y )]
[Equation]
likelihood [Equation] [Table]
[Equation]
This inequality is true for every P X,Y satisfying the marginal conditions.
Thus, similar to VAEs, we can pick P X,Y to maximize the lower bound on average sample log -likelihoods.
This leads to the entropic GAN optimization 2.3.
A PPENDIX B T IGHTNESS OF THE BOUND
In Theorem 1, we showed that the Entropic GAN objective maximizes a lower-bound on the average sample log-likelihoods.
This result is in the same ﬂavor of variational lower bounds used in VAEs, thus providing a connection between these two areas.
One drawback of VAEs in general is about the lack of tightness analysis of the employed variational lower bounds.
In this section, we aim to understand the tightness of the entropic GAN lower bound for some generative models.
Corollary 2 shows that the entropic GAN lower bound is tight when KL ( P X ∣ Y =
y ∣∣
f
X ∣ Y
=
y ) approaches 0 .
Quantifying this term can be useful for assessing the qual- ity of the proposed likelihood surrogate function.
We refer to this term as the approximation gap.
Computing the approximation gap can be difﬁcult in general as it requires evaluating f X ∣ Y =
y .
Here we perform an experiment for linear generative models and a quadratic loss function (same setting of Corrolary 1).
Let the real data Y be generated from the following underlying model
[Equation]
Using the Bayes rule, we have
[Equation]
Since we have a closed-form for f X ∣ Y , KL ( P X ∣ Y
=
y ∣∣
f
X ∣ Y =
y ) can be computed efﬁciently.
The matrix G to generate Y is chosen randomly.
Then, an entropic GAN with a linear generator and non-linear discriminators are trained on this dataset.
P X ∣ Y =
y is then computed using equation 4.3.
Table 1 reports the average surrogate log-likelihood values and the average approximation gaps computed over 100 samples drawn from the underlying data distribution.
We observe that the approximation gap is orders of magnitudes smaller than the log-likelihood values.
Additionally, in Figure 4, we demonstrate the density functions of P X ∣ Y =
y and f X ∣ Y
=
y for a random y and a two-dimensional case ( r = 2 ) .
In this ﬁgure, one can observe that both distributions are very similar to one another making the approximation gap very small.
Architecture and hyper-parameter details:
For the generator network, we used 3 linear layers without any non-linearities ( 2 → 128 → 128 → 2 ).
Thus, it is an over-parameterized linear system.
The discriminator architecture (both D 1 and D 2 ) is a 2-layer MLP with ReLU non-linearities (2 →→ 128 → 1).
λ
= 0 .
1 was used in all the experiments.
Both generator and discriminator were trained using the Adam optimizer with a learning rate 10 − 6 and momentum 0 .
The discriminators were trained for 10 steps per generator iteration.
Batch size of 512 was used.
[Table]
A PPENDIX C O PTIMAL C OUPLING FOR W2GAN
Optimal coupling P ∗ Y, ˆ Y for the W2GAN (quadratic GAN (Feizi et al., 2017)) can be computed using the gradient of the optimal discriminator (Villani, 2008) as follows.
Lemma 2 Let P Y be absolutely continuous whose support contained in a convex set in R d .
Let D opt be the optimal discriminator for a given generator G in W2GAN.
This solution is unique.
Moreover, we have
[Equation]
where dist = means matching distributions.
A PPENDIX D S INKHORN L OSS
In practice, it has been observed that a slightly modiﬁed version of the entropic GAN demonstrates improved computational properties (Genevay et al., 2017; Sanjabi et al., 2018).
We explain this modiﬁcation in this section.
Let
[Equation]
where D KL ( . ∣∣ . ) is the KullbackLeibler divergence.
Note that the objective of this optimization differs from that of the entropic GAN optimization 2.3 by a constant term λH ( P Y ) + λH ( P ˆ Y ) .
A sinkhorn distance function is then deﬁned as (Genevay et al., 2017):
[Equation]
¯ W is called the Sinkhorn loss function.
Reference Genevay et al.
(2017) has shown that as λ → 0 , ¯
W (cid:96),λ ( P Y , P ˆ Y ) approaches W (cid:96),λ ( P Y , P ˆ Y ) .
For a general λ , we have the following upper and lower bounds:
Lemma
For a given λ > 0 , we have
[Equation]
Proof From the deﬁnition equation D.2, we have W (cid:96),λ ( P Y , P ˆ Y ) ∶≥ ¯ W (cid:96),λ ( P Y , P ˆ Y )/ 2 .
Moreover, since W (cid:96),λ ( P Y , P Y ) ≤ H ( P Y ) (this can be seen by using an identity coupling as a feasible solution for optimization D.1) and similarly W (cid:96),λ ( P ˆ Y , P ˆ Y )
≤ H ( P ˆ Y ) , we have W (cid:96),λ ( P Y , P ˆ Y ) ≤ ¯
W (cid:96),λ ( P Y , P ˆ Y )/ 2 + λ / 2 H ( P Y ) + λ / 2 H ( P ˆ Y ) .
Since H ( P Y )
+ H ( P ˆ Y ) is constant in our setup, optimizing the GAN with the Sinkhorn loss is equivalent to optimizing the entropic GAN.
So, our likelihood estimation framework can be used with models trained using Sinkhorn loss as well.
This is particularly important from a practical standpoint as training models with Sinkhorn loss tends to be more stable in practice.
A PPENDIX E T RAINING E NTROPIC GAN S
In this section, we discuss how WGANs with entropic regularization is trained.
As discussed in
Section 3, the dual of the entropic GAN formulation can be written as
[Equation]
where
[Equation]
We can optimize this min-max problem using alternating optimization.
A better approach would be to take into account the smoothness introduced in the problem due to the entropic regularizer, and solve the generator problem to stationarity using ﬁrst-order methods.
Please refer to Sanjabi et al.
(2018) for more details.
In all our experiments, we use Algorithm 1 of Sanjabi et al.
(2018) to train our GAN model.
E. GAN’ S T RAINING ON MNIST
MNIST dataset constains 28 × 28 grayscale images.
As a pre-processing step, all images were resized in the range [ 0 , 1 ] .
The Discriminator and the Generator architectures used in our experiments are given in Tables.
Note that the dual formulation of GANs employ two discriminators - D 1 and
D 2 , and we use the same architecture for both.
The hyperparameter details are given in Table 4.
Some sample generations are shown in Fig.
E. GAN’ S T RAINING ON CIFAR
We trained a DCGAN model on CIFAR dataset using the discriminator and generator architecture used in Radford et al.
The hyperparamer details are mentioned in Table.
Some sample generations are provided in Figure
[Table]
[Table]
E. GAN’ S T RAINING ON LSUN-B EDROOMS DATASET
We trained a WGAN model on LSUN-Bedrooms dataset with DCGAN architectures for generator and discriminator networks (Arjovsky et al., 2017).
The hyperparameter details are given in Table.
6, and some sample generations are provided in Fig.
[Table] [Table] [Table]