S OBOLEV GAN
A BSTRACT
We propose a new Integral Probability Metric (IPM) between distributions: the
Sobolev IPM.
The Sobolev IPM compares the mean discrepancy of two distributions for functions (critic) restricted to a Sobolev ball deﬁned with respect to a dominant measure µ .
We show that the Sobolev IPM compares two distributions in high dimensions based on weighted conditional Cumulative Distribution Functions (CDF) of each coordinate on a leave one out basis.
The Dominant measure µ plays a crucial role as it deﬁnes the support on which conditional CDFs are compared.
Sobolev IPM can be seen as an extension of the one dimensional VonMises Cram ´ er statistics to high dimensional distributions.
We show how Sobolev
IPM can be used to train Generative Adversarial Networks (GANs).
We then exploit the intrinsic conditioning implied by Sobolev IPM in text generation.
Finally we show that a variant of Sobolev GAN achieves competitive results in semisupervised learning on CIFAR-10, thanks to the smoothness enforced on the critic by Sobolev GAN which relates to Laplacian regularization.
I NTRODUCTION
In order to learn Generative Adversarial Networks (Goodfellow et al., 2014), it is now well established that the generator should mimic the distribution of real data, in the sense of a certain discrepancy measure.
Discrepancies between distributions that measure the goodness of the ﬁt of the neural generator to the real data distribution has been the subject of many recent studies (Arjovsky & Bottou, 2017;
Nowozin et al., 2016; Kaae Sønderby et al., 2017; Mao et al., 2017; Arjovsky et al., 2017; Gulrajani et al., 2017; Mroueh et al., 2017; Mroueh & Sercu, 2017; Li et al., 2017), most of which focus on training stability.
In terms of data modalities, most success was booked in plausible natural image generation after the introduction of Deep Convolutional Generative Adversarial Networks (DCGAN)
(Radford et al., 2015).
This success is not only due to advances in training generative adversarial networks in terms of loss functions (Arjovsky et al., 2017) and stable algorithms, but also to the representation power of convolutional neural networks in modeling images and in ﬁnding sufﬁcient statistics that capture the continuous density function of natural images.
When moving to neural generators of discrete sequences generative adversarial networks theory and practice are still not very well understood.
Maximum likelihood pre-training or augmentation, in conjunction with the use of reinforcement learning techniques were proposed in many recent works for training GAN for discrete sequences generation (Yu et al., 2016;
Che et al., 2017; Hjelm et al., 2017; Rajeswar et al., 2017).
Other methods included using the Gumbel Softmax trick (Kusner & Hern´andez-Lobato, 2016) and the use of auto-encoders to generate adversarially discrete sequences from a continuous space (Zhao et al., 2017).
End to end training of GANs for discrete sequence generation is still an open problem (Press et al., 2017).
Empirical successes of end to end training have been reported within the framework of WGAN-GP (Gulrajani et al., 2017), using a proxy for the Wasserstein distance via a pointwise gradient penalty on the critic.
Inspired by this success, we propose in this paper a new Integral Probability Metric (IPM) between distributions that we coin Sobolev IPM .
Intuitively an IPM (M¨uller, 1997) between two probability distributions looks for a witness function f , called critic, that maximally discriminates between samples coming from the two distributions:
[Equation]
Traditionally, the function f is deﬁned over a function class F that is independent to the distributions at hand (Sriperumbudur et al., 2012).
The Wasserstein- 1 distance corresponds for instance to an IPM where the witness functions are deﬁned over the space of Lipschitz functions; The MMD distance (Gretton et al., 2012) corresponds to witness functions deﬁned over a ball in a Reproducing Kernel
Hilbert Space (RKHS).
We will revisit in this paper Fisher IPM deﬁned in (Mroueh & Sercu, 2017), which extends the IPM deﬁnition to function classes deﬁned with norms that depend on the distributions.
Fisher IPM can be seen as restricting the critic to a Lebsegue ball deﬁned with respect to a dominant measure µ .
The Lebsegue norm is deﬁned as follows:
[Equation]
where µ is a dominant measure of P and Q .
In this paper we extend the IPM framework to critics bounded in the Sobolev norm: ˆ
[Equation]
In contrast to Fisher IPM, which compares joint probability density functions of all coordinates between two distributions, we will show that Sobolev IPM compares weighted (coordinate-wise) conditional Cumulative Distribution Functions for all coordinates on a leave on out basis.
Matching conditional dependencies between coordinates is crucial for sequence modeling .
Our analysis and empirical veriﬁcation show that the modeling of the conditional dependencies can be built in to the metric used to learn GANs as in Sobolev IPM.
For instance, this gives an advantage to Sobolev IPM in comparing sequences over Fisher IPM.
Nevertheless, in sequence modeling when we parametrize the critic and the generator with a neural network, we ﬁnd an interesting tradeoff between the metric used and the architectures used to parametrize the critic and the generator as well as the conditioning used in the generator.
The burden of modeling the conditional long term dependencies can be handled by the IPM loss function as in Sobolev IPM (more accurately the choice of the data dependent function class of the critic) or by a simpler metric such as Fisher IPM together with a powerful architecture for the critic that models conditional long term dependencies such as LSTM or GRUs in conjunction with a curriculum conditioning of the generator as done in (Press et al., 2017).
Highlighting those interesting tradeoffs between metrics, data dependent functions classes for the critic (Fisher or Sobolev) and architectures is crucial to advance sequence modeling and more broadly structured data generation using GANs.
On the other hand, Sobolev norms have been widely used in manifold regularization in the so called
Laplacian framework for semi-supervised learning (SSL) (Belkin et al., 2006).
GANs have shown success in semi-supervised learning (Salimans et al., 2016; Dumoulin et al., 2017; Dai et al., 2017;
Kumar et al., 2017).
Nevertheless, many normalizations and additional tricks were needed.
We show in this paper that a variant of Sobolev GAN achieves strong results in semi-supervised learning on
CIFAR-10, without the need of any activation normalization in the critic.
The main contributions of this paper can be summarized as follows:
We overview in Section 2 different metrics between distribution used in the GAN literature.
We then generalize Fisher IPM in Section 3 with a general dominant measure µ and show how it compares distributions based on their PDFs.
We introduce Sobolev IPM in Section 4 by restricting the critic of an IPM to a Sobolev ball deﬁned with respect to a dominant measure µ .
We then show that Sobolev IPM deﬁnes a discrepancy between weighted (coordinate-wise) conditional CDFs of distributions.
The intrinsic conditioning and the CDF matching make Sobolev IPM suitable for discrete sequence matching and explain the success of the gradient pernalty in WGAN-GP and Sobolev GAN in discrete sequence generation.
We give in Section 5 an ALM (Augmented Lagrangian Multiplier) algorithm for training Sobolev GAN.
Similar to Fisher GAN, this algorithm is stable and does not compromise the capacity of the critic.
We show in Appendix A that the critic of Sobolev IPM satisﬁes an elliptic Partial Differential Equation (PDE).
We relate this diffusion to the Fokker-Planck equation and show the behavior of the gradient of the optimal Sobolev critic as a transportation plan between distributions.
We empirically study Sobolev GAN in character level text generation (Section 6.1).
We validate that the conditioning implied by Sobolev GAN is crucial for the success and stability of GAN in text generation.
As a take home message from this study, we see that text generation succeeds either by implicit conditioning i.e using Sobolev GAN (or WGANGP) together with convolutional critics and generators, or by explicit conditioning i.e using Fisher IPM together with recurrent critic and generator and curriculum learning.
We ﬁnally show in Section 6.2 that a variant of Sobolev GAN achieves competitive semisupervised learning results on CIFAR-10, thanks to the smoothness implied by the Sobolev regularizer.
O VERVIEW OF M ETRICS BETWEEN D ISTRIBUTIONS
In this Section, we review different representations of probability distributions and metrics for comparing distributions that use those representations.
Those metrics are at the core of training GAN.
In what follows we consider probability measures with a positive weakly differentiable probability density functions (PDF).
Let P and Q be two probability measures with PDFs P ( x ) and Q ( x ) deﬁned on X ⊂ R d .
Let F P and F Q be the Cumulative Distribution Functions (CDF) of P and Q respectively.
For x = ( x 1 , . . .
, x d ) , we have:
[Equation]
x ) = ˆ x−∞ . . .
ˆ x d −∞
P ( u 1 , . . .
u d ) du 1 . . .
du d .
The score function of a density function is deﬁned as: s P ( x ) = ∇ x log( P ( x ))
∈ R d .
In this work, we are interested in metrics between distributions that have a variational form and can be written as a suprema of mean discrepancies of functions deﬁned on a speciﬁc function class.
This type of metrics include ϕ -divergences as well as Integral Probability Metrics (Sriperumbudur et al., 2009) and have the following form:
[Equation]
where F is a function class deﬁned on X and ∆ is a mean discrepancy, ∆ : F → R .
The variational form given above leads in certain cases to closed form expressions in terms of the PDFs P , Q or in terms of the CDFs F P , F Q or the score functions s P , s Q .
In Table 1, we give a comparison of different discrepancies ∆ and function spaces F used in the literature for GAN training together with our proposed Sobolev IPM.
We see from Table 1 that
Sobolev IPM, compared to Wasserstein Distance, imposes a tractable smoothness constraint on the critic on points sampled from a distribution µ , rather then imposing a Lipschitz constraint on all points in the space X .
We also see that Sobolev IPM is the natural generalization of the Cram´er
Von-Mises Distance from one dimension to high dimensions.
We note that the Energy Distance, a form of Maximum Mean Discrepancy for a special kernel, was used in (Bellemare et al., 2017b) as a generalization of the Cram´er distance in GAN training but still needed a gradient penalty in its algorithmic counterpart leading to a mis-speciﬁed distance between distributions.
Finally it is worth noting that when comparing Fisher IPM and Sobolev IPM we see that while Fisher IPM compares joint PDF of the distributions, Sobolev IPM compares weighted (coordinate-wise) conditional
CDFs.
As we will see later, this conditioning nature of the metric makes Sobolev IPM suitable for comparing sequences.
Note that the Stein metric (Liu et al., 2016; Liu, 2017) uses the score function to match distributions.
We will show later how Sobolev IPM relates to the Stein discrepancy (Appendix A).
[Table] [Table] [Table] ∼ P
[Table]
P
[Table]
E [Equation] x ) (cid:110) f : X [Equation]
[Table]
E
[Table]
µ
[Table]
P
[Table]
[Table]
[Table]
x
[Table]
[Equation]
[Table]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Table]
[Table] [Table] di = [Table]
φ i [Table] P ) − φ i [Table]
[Table]
φ i [Table] P ) = P X
[Table]
i )
[Table]
P [ Xi | X − i = x
[Table] i ]
[Table] i ) x − [Table]
= ( x 1 ,...x
[Table]
− 1 ,x i +1 ,...
x d )
G ENERALIZING F ISHER IPM: PDF C OMPARISON
Imposing data-independent constraints on the function class in the IPM framework, such as the
Lipschitz constraint in the Wasserstein distance is computationally challenging and intractable for the general case.
In this Section, we generalize the Fisher IPM introduced in (Mroueh & Sercu, 2017), where the function class is relaxed to a tractable data dependent constraint on the second order moment of the critic, in other words the critic is constrained to be in a Lebsegue ball.
Fisher IPM.
Let X ⊂ R d and P ( X ) be the space of distributions deﬁned on X .
Let P , Q ∈ P (
X ) , and µ be a dominant measure of P and Q , in the sense that
[Equation]
We assume µ to be also a distribution in P ( X ) , and assume µ ( x ) > 0 , ∀ x ∈ X .
Let L 2 ( X , µ ) be the space of µ -measurable functions.
For f, g ∈ L 2 ( X , µ ) , we deﬁne the following dot product and its corresponding norm:
[Equation]
Note that L 2 ( X , µ ) , can be formally deﬁned as follows:
[Equation]
We deﬁne the unit Lebesgue ball as follows:
[Equation]
Fisher IPM deﬁned in (Mroueh & Sercu, 2017), searches for the critic function in the Lebesgue Ball
B 2 ( X , µ ) that maximizes the mean discrepancy between P and Q .
Fisher GAN (Mroueh & Sercu, 2017) was originally formulated speciﬁcally for µ = 12 ( P + Q ) .
We consider here a general µ as long as it dominates P and Q .
We deﬁne Generalized Fisher IPM as follows:
[Equation]
Note that:
[Equation]
Hence Fisher IPM can be written as follows:
[Equation]
We have the following result:
Theorem 1 (Generalized Fisher IPM) .
The Fisher distance and the optimal critic are as follows:
The Fisher distance is given by:
[Equation]
The optimal f χ achieving the Fisher distance F µ ( P , Q ) is:
[Equation]
µ , µ almost surely .
Proof of Theorem 1.
From Equation (2), the optimal f χ belong to the intersection of the hyperplane that has normal n = P − Q µ , and the ball B 2 ( X , µ ) , hence f χ = n (cid:107) n (cid:107) L 2( X ,µ ) .
Hence F ( P , Q ) = (cid:107) n (cid:107) L 2 ( X ,µ ) .
k f k L 2 ( X ,µ ) = P  Q µ f
We see from Theorem 1 the role of the dominant measure µ : the optimal critic is deﬁned with respect to this measure and the overall Fisher distance can be seen as an average weighted distance between probability density functions , where the average is taken on points sampled from µ .
We give here some choices of µ :
For µ = 1 2 ( P + Q ) , we obtain the symmetric chi-squared distance as deﬁned in (Mroueh & Sercu, 2017).
µ GP , the implicit distribution deﬁned by the interpolation lines between P r and Q θ as in (Gulrajani et al., 2017).
When µ does not dominate P , and Q , we obtain a non symmetric divergence.
For example for µ = P , F 2 P ( P , Q ) =
´
X ( P ( x ) − Q ( x )) 2 P ( x ) dx .
We see here that for this particular choice we obtain the Pearson divergence.
S OBOLEV IPM
In this Section, we introduce the Sobolev IPM.
In a nutshell, the Sobolev IPM constrains the critic function to belong to a ball in the restricted Sobolev Space.
In other words we constrain the norm of the gradient of the critic ∇ x f ( x ) .
We will show that by moving from a Lebesgue constraint as in Fisher IPM to a Sobolev constraint as in Sobolev IPM, the metric changes from a joint PDF matching to weighted (ccordinate-wise) conditional CDFs matching.
The intrinsic conditioning built in to the Sobolev IPM and the comparison of cumulative distributions makes Sobolev IPM suitable for comparing discrete sequences.
4. D EFINITION AND E XPRESSION OF S OBOLEV IPM IN TERMS OF C OORDINATE C ONDITIONAL CDF S
We will start by recalling some deﬁnitions on Sobolev Spaces.
We assume in the following that X is compact and consider functions in the Sobolev space W 1 , 2 ( X , µ ) :
[Equation]
We restrict ourselves to functions in W 1 , 2 ( X , µ ) vanishing at the boundary, and note this space
W 1 , 2 0 ( X , µ ) .
Note that in this case:
[Equation]
deﬁnes a semi-norm.
We can similarly deﬁne a dot product in W 1 , 2 0 ( X , µ ) , for f, g ∈ W 1 , 2 0 ( X , µ ) :
[Equation]
Hence we deﬁne the following Sobolev IPM, by restricting the critic of the mean discrepancy to the
Sobolev unit ball :
[Equation]
When compared to the Wasserstein distance, the Sobolev IPM given in Equation (3) uses a data dependent gradient constraint (depends on µ ) rather than a data independent Lipchitz constraint.
Let
F P and F Q be the cumulative distribution functions of P and Q respectively.
We have:
[Equation]
and we deﬁne
[Equation]
D − i computes the ( d − 1) high-order partial derivative excluding the variable i .
Our main result is presented in Theorem 2.
Additional theoretical results are given in Appendix A.
All proofs are given in Appendix B.
Theorem 2 (Sobolev IPM) .
Assume that F P , and F Q and its d derivatives exist and are continuous:
F P and F Q ∈ C d ( X ) .
Deﬁne the differential operator D − :
[Equation]
For x = ( x 1 , . . .
x i − 1 , x i , x i +1 , . . .
x d ) , let x − i =
( x 1 , . . .
x i − 1 , x i +1 , . . .
x d ) .
The Sobolev IPM given in Equation (3) has the following equivalent forms:
Sobolev IPM as comparison of high order partial derivatives of CDFs.
The Sobolev IPM has the following form:
[Equation]
Sobolev IPM as comparison of weighted (coordinate-wise) conditional CDFs.
The Sobolev IPM can be written in the following equivalent form:
[Equation]
The optimal critic f ∗ satisﬁes the following identity:
[Equation]
Sobolev IPM Approximation.
Learning in the whole Sobolev space W 1 , 2is challenging hence we need to restrict our function class to a hypothesis class H , such as neural networks.
We assume in the following that functions in H vanish on the boundary of X , and restrict the optimization to the function space H .
H can be a Reproducing Kernel Hilbert Space as in the MMD case or parametrized by a neural network.
Deﬁne the Sobolev IPM approximation in H :
[Equation]
The following Lemma shows that the Sobolev IPM approximation in H is proportional to Sobolev
IPM.
The tightness of the approximation of the Sobolev IPM is governed by the tightness of the approximation of the optimal Sobolev Critic f ∗ in H .
This approximation is measured in the
Sobolev sense, using the Sobolev dot product.
Lemma 1 (Sobolev IPM Approximation in a Hypothesis Class) .
Let H be a function space with functions vanishing at the boundary.
For any f ∈ H and for f ∗ the optimal critic in W 1 , 2 0 , we have:
[Equation]
Note that this Lemma means that the Sobolev IPM is well approximated if the space H has an enough representation power to express ∇ x f ∗ ( x ) .
This is parallel to the Fisher IPM approximation (Mroueh & Sercu, 2017) where it is shown that the Fisher IPM approximation error is proportional to the critic approximation in the Lebesgue sense.
Having in mind that the gradient of the critic is the information that is passed on to the generator, we see that this convergence in the Sobolev sense to the optimal critic is an important property for GAN training.
Relation to Fokker-Planck Diffusion.
We show in Appendix A that the optimal Sobolev critic is the solution of the following elliptic PDE (with zero boundary conditions):
[Equation]
We further link the elliptic PDE given in Equation (8) and the Fokker-Planck diffusion.
As we illustrate in Figure 2(b) the gradient of the critic deﬁnes a transportation plan for moving the distribution mass from Q to P .
Discussion of Theorem 2.
We make the following remarks on Theorem 2:
From Theorem 2, we see that the Sobolev IPM compares d higher order partial derivatives of the cumulative distributions F P and F Q , while Fisher IPM compares the probability density functions.
The dominant measure µ plays a similar role to Fisher:
[Equation]
the average distance is deﬁned with respect to points sampled from µ .
3. Comparison of coordinate-wise Conditional CDFs.
We note in the following x − i =
( x 1 , . . .
x i − 1 , x i +1 , . . .
x d ) .
Note that we have:
[Equation]
(Using Bayes rule)
[Equation]
Note that for each i , D − i F P ( x ) is the cumulative distribution of the variable X
i given the other variables X − i = x − i , weighted by the density function of X − i at x − i .
This leads us to the form given in Equation 5.
We see that the Sobolev IPM compares for each dimension i the conditional cumulative distribution of each variable given the other variables, weighted by their density function.
We refer to this as comparison of coordinate-wise CDFs on a leave one out basis.
From this we see that we are comparing CDFs, which are better behaved on discrete distributions.
Moreover, the conditioning built in to this metric will play a crucial role in comparing sequences as the conditioning is important in this context (See section 6.1).
4. I LLUSTRATIVE E XAMPLES
Sobolev IPM / Cram´er Distance and Wasserstein-1 in one Dimension.
In one dimension,
Sobolev IPM is the Cram ´ er Distance (for µ uniform on X , we note this µ := 1 ).
While Sobolev
IPM in one dimension measures the discrepancy between CDFs, the one dimensional Wasserstein-
p distance measures the discrepancy between inverse CDFs:
[Equation]
Recall also that the Fisher IPM for uniform µ is given by :
[Equation]
Consider for instance two point masses P = δ a 1 and Q = δ a 2 with a 1 , a 2 ∈ R .
The rationale behind using Wasserstein distance for GAN training is that since it is a weak metric, for far distributions
Wasserstein distance provides some signal (Arjovsky et al., 2017).
In this case, it is easy to see that
W 1 1 ( P , Q ) =
S 2 µ :=1 = | a 1 − a 2 | , while F 2 µ :=1 ( P , Q ) = 2 .
As we see from this simple example, CDF comparison is more suitable than PDF for comparing distributions on discrete spaces .
See
Figure 1, for a further discussion of this effect in the GAN context.
Sobolev IPM between two 2D Gaussians.
We consider P and Q to be two dimensional Gaussians with means µ 1 and µ 2 and covariances Σ 1 and Σ 2 .
Let ( x, y ) be the coordinates in 2D.
We note F P and F Q the CDFs of P and Q respectively.
We consider in this example µ = P + Q 2 .
We know from
Theorem 2 that the gradient of the Sobolev optimal critic is proportional to the following vector ﬁeld:
[Equation]
In Figure 2 we consider µ 1 = [1 , 0] , Σ
[Equation]
In Figure 2(a) we plot the numerical solution of the PDE satisﬁed by the optimal Sobolev critic given in Equation (8), using M ATLAB solver for elliptic PDEs (more accurately we solve − div ( µ ( x ) ∇ x f ( x ))
=
P ( x ) − Q ( x ) , hence we obtain the solution of Equation (8) up to a normalization constant (
S µ ( P , Q ) )).
We numerically solve the PDE on a rectangle with zero boundary D e n s i t y p ( x ) q ( x )    10 0. C u m u l a t i v e
D e n s i t y
F p ( x ) F q ( x )
[Figure] D e n s i t y p ( x ) q ( x )    10 0. C u m u l a t i v e
D e n s i t y
F p ( x ) F q ( x )
[Figure] conditions. We see that the optimal Sobolev critic separates the two distributions well. In Figure 2(b) we then numerically compute the gradient of the optimal Sobolev critic on a 2D grid as given in Equation 9 (using numerical evaluation of the CDF and ﬁnite difference for the evaluation of the partial derivatives).
We plot in Figure 2(b) the density functions of P and Q as well as the vector ﬁeld of the gradient of the optimal Sobolev critic.
As discussed in Section A.1, we see that the gradient of the critic (wrt to the input), deﬁnes on the support of µ = P + Q 2 a transportation plan for moving the distribution mass from Q to P .
S OBOLEV GAN
Now we turn to the problem of learning GANs with Sobolev IPM.
Given the “real distribution”
P r ∈ P ( X ) , our goal is to learn a generator g θ : Z ⊂ R n z → X , such that for z ∼ p
z , the distribution of g θ
( z ) is close to the real data distribution P r , where p z is a ﬁxed distribution on Z (for instance z ∼ N (0 , I n z ) ).
We note Q θ for the “fake distribution” of g θ ( z ) , z ∼ p z .
Consider { x i , i = 1 . . .
N } ∼ P r , { z i , i = 1 . . .
N } ∼ N (0 , I n z ) , and { ˜ x i , i = 1 . . .
N } ∼ µ .
We consider these choices for µ :
µ = P r + Q θi.e ˜ x ∼ P r or ˜ x
= g θ ( z ) , z ∼ p z with equal probability 12 .
µ GP is the implicit distribution deﬁned by the interpolation lines between P r and Q θ as in (Gulrajani et al., 2017)
i.e : ˜ x
= ux + (1 − u )
y, x ∼ P r , y
= g θ ( z ) , z ∼ p z and u ∼ Unif [0 , 1] .
Sobolev GAN can be written as follows:
[Equation]
For any choice of the parametric function class H p , note the constraint by ˆΩ S ( f p , g θ )
= 1 N (cid:80)
[Equation]
x i ) (cid:107) 2 .
For example if µ = P r + Q θ
[Equation]
[Figure] [Equation] [Equation] Note that, since the optimal theoretical critic is achieved on the sphere, we impose a sphere constraint rather than a ball constraint.
Similar to (Mroueh & Sercu, 2017) we deﬁne the Augmented Lagrangian corresponding to Sobolev GAN objective and constraint
[Equation]
where λ is the Lagrange multiplier and ρ > 0 is the quadratic penalty weight.
We alternate between optimizing the critic and the generator.
We impose the constraint when training the critic only.
Given θ , we solve max p min λ L S ( p, θ, λ ) , for training the critic.
Then given the critic parameters p
we optimize the generator weights θ to minimize the objective min θ ˆ E ( f p , g θ ) .
See Algorithm 1.
Input: ρ penalty weight, η Learning rate, n c number of iterations for training the critic, N batch size
Initialize p, θ, λ =repeatfor j = 1 to n c do
Sample a minibatch x i ,
[Table]
Remark 1.
Note that in Algorithm 1, we obtain a biased estimate since we are using same samples for the cost function and the constraint, but the incurred bias can be shown to be small and vanishing as the number of samples increases as shown and justiﬁed in (Shivaswamy & Jebara, 2010).
Relation to WGAN-GP.
WGAN-GP can be written as follows:
[Equation]
The main difference between WGAN-GP and our setting, is that WGAN-GP enforces pointwise constraints on points drawn from µ = µ GP via a point-wise quadratic penalty ( ˆ E ( f p , g θ ) − λ
[Equation]
(cid:107)∇ x f (˜ x i ) (cid:107) ) 2 ) while we enforce that constraint on average as a Sobolev norm, allowing us the coordinate weighted conditional CDF interpretation of the IPM.
A PPLICATIONS OF S OBOLEV GAN
Sobolev IPM has two important properties; The ﬁrst stems from the conditioning built in to the metric through the weighted conditional CDF interpretation.
The second stems from the diffusion properties that the critic of Sobolev IPM satisﬁes (Appendix A) that has theoretical and practical ties to the Laplacian regularizer and diffusion on manifolds used in semi-supervised learning (Belkin et al., 2006).
In this Section, we exploit those two important properties in two applications of Sobolev GAN: Text generation and semi-supervised learning.
First in text generation , which can be seen as a discrete sequence generation, Sobolev GAN (and WGAN-GP) enable training GANs without need to do explicit brute-force conditioning.
We attribute this to the built-in conditioning in Sobolev IPM (for the sequence aspect) and to the CDF matching (for the discrete aspect).
Secondly using GANs in semi-supervised learning is a promising avenue for learning using unlabeled data.
We show that a variant of Sobolev GAN can achieve strong SSL results on the CIFAR-10 dataset, without the need of any form of activation normalization in the networks or any extra ad hoc tricks.
6. T EXT G ENERATION WITH S OBOLEV GAN
In this Section, we present an empirical study of Sobolev GAN in character level text generation.
Our empirical study on end to end training of character-level GAN for text generation is articulated on four dimensions (loss, critic, generator, µ ) .
(1) the loss used ( GP : WGAN-GP (Gulrajani et al., 2017), S : Sobolev or F : Fisher) (2) the architecture of the critic (Resnets or RNN) (3) the architecture of the generator (Resnets or RNN or RNN with curriculum learning) (4) the sampling distribution µ in the constraint.
Text Generation Experiments.
We train a character-level GAN on Google Billion Word dataset and follow the same experimental setup used in (Gulrajani et al., 2017).
The generated sequence length is 32 and the evaluation is based on Jensen-Shannon divergence on empirical 4-gram probabilities (JS-4) of validation data and generated data.
JS-4 may not be an ideal evaluation criteria, but it is a reasonable metric for current character-level GAN results, which is still far from generating meaningful sentences.
Annealed Smoothing of discrete P r in the constraint µ .
Since the generator distribution will always be deﬁned on a continuous space, we can replace the discrete “real” distribution P r with a smoothed version (Gaussian kernel smoothing)
P r (cid:63) N (0 , σ 2 I d ) .
This corresponds to doing the following sampling for P r : x + ξ, x ∼ P r , and ξ ∼ N (0 , σ 2 I d ) .
Note that we only inject noise to the “real” distribution with the goal of smoothing the support of the discrete distribution, as opposed to instance noise on both “real” and “fake” to stabilize the training, as introduced in (Kaae Sønderby et al., 2017; Arjovsky & Bottou, 2017).
As it is common in optimization by continuation (Mobahi & III, 2015), we also anneal the noise level σ as the training progresses on a linear schedule.
Sobolev GAN versus WGAN-GP with Resnets.
In this setting, we compare (WGANGP,G = Resnet,D = Resnet, µ = µ GP ) to (Sobolev,G = Resnet,D = Resnet, µ ) where µ is one of: (1) µ GP , (2) the noise smoothed µ s ( σ [Equation] =
[Equation] or (3) noise smoothed with annealing µ as ( σ 0 ) with σ 0 the initial noise level.
We use the same architectures of Resnet with 1D convolution for the critic and the generator as in (Gulrajani et al., 2017) (4 resnet blocks with hidden layer size of 512 ).
In order to implement the noise smoothing we transform the data into one-hot vectors.
Each one hot vector x is transformed to a probability vector p with 0 .
9 replacing the one and 0 .
1 / ( dict size − 1) replacing the zero.
We then sample (cid:15) from a Gaussian distribution N (0 , σ 2 ) , and [Figure] use softmax to normalize log p + (cid:15) .
We use algorithm 1 for Sobolev GAN and ﬁx the learning rate to 10 − 4 and ρ to 10 − 5 .
The noise level σ was annealed following a linear schedule starting from an initial noise level σ 0 (at iteration i , σ i = σ 0 (1 − i Maxiter ) , Maxiter= 30 K).
For WGAN-GP we used the open source implementation with the penalty λ
= 10 as in (Gulrajani et al., 2017).
Results are given in Figure 3(a) for the JS-4 evaluation of both WGAN-GP and Sobolev GAN for µ = µ GP .
In Figure 3(b) we show the JS-4 evaluation of Sobolev GAN with the annealed noise smoothing µ as ( σ 0 ) , for various values of the initial noise level σ 0 .
We see that the training succeeds in both cases.
Sobolev GAN achieves slightly better results than WGAN-GP for the annealing that starts with high noise level σ 0 = 1 . 5 .
We note that without smoothing and annealing i.e using µ =
P r + Q θ,
Sobolev GAN is behind.
Annealed smoothing of P r , helps the training as the real distribution is slowly going from a continuous distribution to a discrete distribution.
See Appendix C
(Figure 6) for a comparison between annealed and non annealed smoothing.
We give in Appendix C a comparison of WGAN-GP and Sobolev GAN for a Resnet generator architecture and an RNN critic.
The RNN has degraded performance due to optimization difﬁculties.
Fisher GAN Curriculum Conditioning versus Sobolev GAN:
Explicit versus Implicit conditioning.
We analyze how Fisher GAN behaves under different architectures of generators and critics.
We ﬁrst ﬁx the generator to be ResNet.
We study 3 different architectures of critics: ResNet, GRU (we follow the experimental setup from (Press et al., 2017)), and hybrid ResNet+GRU (Reed et al., 2016).
We notice that RNN is unstable, we need to clip the gradient values of critics in [ − 0 .
5 , 0 . 5] , and the gradient of the Lagrange multiplier λ F to [ − 10 4 , 10 4 ] .
We ﬁx ρ F = 10 − 7 and we use µ = µ GP .
We search the value for the learning rate in [10 − 5 , 10 − 4 ] .
We see that for µ = µ GP and
G = Resnet for various critic architectures, Fisher GAN fails at the task of text generation (Figure 4 a-c).
Nevertheless, when using RNN critics (Fig 4 b, c) a marginal improvement happens over the fully collapsed state when using a resnet critic (Fig 4 a).
We hypothesize that RNN critics enable some conditioning and factoring of the distribution, which is lacking in Fisher IPM.
Finally Figure 4 (d) shows the result of training with recurrent generator and critic.
We follow (Press et al., 2017) in terms of GRU architecture, but differ by using Fisher GAN rather than WGAN-GP.
We use µ = P r + Q θi.e.
without annealed noise smoothing.
We train (F, D=RNN,G=RNN, P r + Q θ) using curriculum conditioning of the generator for all lengths (cid:96) as done in (Press et al., 2017): the generator is conditioned on 32 − (cid:96) characters and predicts the (cid:96) remaining characters.
We increment (cid:96) =
1 to 32 on a regular schedule (every 15k updates).
JS-4 is only computed when (cid:96) > 4 .
We see in Figure 4 that under curriculum conditioning with recurrent critics and generators, the training of
Fisher GAN succeeds and reaches similar levels of Sobolev GAN (and WGAN-GP).
Note that the need of this explicit brute force conditioning for Fisher GAN, highlights the implicit conditioning induced by Sobolev GAN via the gradient regularizer, without the need for curriculum conditioning. [Figure]
6. S EMI -S UPERVISED L EARNING WITH S OBOLEV GAN
A proper and promising framework for evaluating GANs consists in using it as a regularizer in the semi-supervised learning setting (Salimans et al., 2016; Dumoulin et al., 2017; Kumar et al., 2017)
As mentioned before the Sobolev norm as a regularizer for the Sobolev IPM draws connections with the Laplacian regularization in manifold learning (Belkin et al., 2006).
In the Laplacian framework of semi-supervised learning, the classiﬁer satisﬁes a smoothness constraint imposed by controlling its Sobolev norm:
[Equation]
et al., 2016).
In this Section, we present a variant of Sobolev GAN that achieves competitive performance in semi-supervised learning on the CIFAR10 dataset Krizhevsky & Hinton (2009) without using any internal activation normalization in the critic, such as batch normalization (BN) (Ioffe & Szegedy, 2015), layer normalization (LN)
(Ba et al., 2016), or weight normalization (Salimans & Kingma, 2016).
In this setting, a convolutional neural network Φ ω : X → R m is shared between the cross entropy (CE) training of a K -class classiﬁer ( S ∈ R K × m ) and the critic of GAN (See Figure 5).
We have the following training equations for the (critic + classifer) and the generator: [Equation]
[Equation]
where the main IPM objective with N samples: ˆ E ( f, g θ ) = 1 N
[Equation]
Following (Mroueh & Sercu, 2017) we use the following “ K +1 parametrization” for the critic (See
Figure 5) :
[Equation]
Note that p ( y | x ) =
Softmax( (cid:104) S , Φ ω (x) (cid:105) )
y appears both in the critic formulation and in the Cross- Entropy term in Equation (11).
Intuitively this critic uses the K class directions of the classiﬁer
S y to deﬁne the “real” direction, which competes with another K+
th direction v that indicates fake samples.
This parametrization adapts the idea of (Salimans et al., 2016), which was formulated speciﬁcally for the classic KL / JSD based GANs, to IPM-based GANs.
We saw consistently better results with the K + 1 formulation over the regular formulation where the classiﬁcation layer S doesn’t interact with the critic direction v .
We also note that when applying a gradient penalty based constraint (either WGAN-GP or Sobolev) on the full critic f
= f + − f − , it is impossible for the network to ﬁt even the small labeled training set (underﬁtting), causing bad SSL performance.
This leads us to the formulation below, where we apply the Sobolev constraint only on f − .
Throughout this Section we ﬁx µ = P r + Q θ.
We propose the following two schemes for constraining the K+1 critic f ( x ) =
f
+ ( x ) − f − ( x ) : 1) Fisher constraint on the critic :
We restrict the critic to the following set:
[Equation]
This constraint translates to the following ALM objective in Equation (11):
[Equation]
where the Fisher constraint ensures the stability of the training through an implicit whitened mean matching (Mroueh & Sercu, 2017).
2) Fisher+Sobolev constraint: We impose 2 constraints on the critic: Fisher on f & Sobolev on f − f [Equation] and
[Equation]
where ˆΩ S ( f − , g θ ) = 12 N (cid:16)(cid:80)
[Equation]
This constraint translates to the following ALM in Equation (11):
[Equation]
Note that the ﬁsher constraint on f ensures the stability of the training, and the Sobolev constraints on the “fake” critic f − enforces smoothness of the “fake” critic and thus the shared CNN Φ ω ( x ) .
This is related to the classic Laplacian regularization in semi-supervised learning (Belkin et al., 2006).
Table 2 shows results of SSL on CIFAR-10 comparing the two proposed formulations.
Similar to the standard procedure in other GAN papers, we do hyperparameter and model selection on the validation set.
We present baselines with a similar model architecture and leave out results with signiﬁcantly larger convnets.
G and D architectures and hyperparameters are in Appendix D. Φ ω is similar to (Salimans et al., 2016; Dumoulin et al., 2017; Mroueh & Sercu, 2017) in architecture, but note that we do not use any batch, layer, or weight normalization yet obtain strong competitive accuracies.
We hypothesize that we don’t need any normalization in the critic, because of the implicit whitening of the feature maps introduced by the Fisher and Sobolev constraints as explained in (Mroueh & Sercu, 2017). [Equation] “real” [Equation]
critic
GAN critic
[Equation] [Figure] [Table]  C ONCLUSION
We introduced the Sobolev IPM and showed that it amounts to a comparison between weighted (coordinate-wise) CDFs.
We presented an ALM algorithm for training Sobolev GAN.
The intrinsic conditioning implied by the Sobolev IPM explains the success of gradient regularization in Sobolev
GAN and WGAN-GP on discrete sequence data, and particularly in text generation.
We highlighted the important tradeoffs between the implicit conditioning introduced by the gradient regularizer in
Sobolev IPM, and the explicit conditioning of Fisher IPM via recurrent critics and generators in conjunction with the curriculum conditioning.
Both approaches succeed in text generation.
We showed that Sobolev GAN achieves competitive semi-supervised learning results without the need of any normalization, thanks to the smoothness induced by the gradient regularizer.
We think the
Sobolev IPM point of view will open the door for designing new regularizers that induce different types of conditioning for general structured/discrete/graph data beyond sequences.
A T HEORY : A PPROXIMATION AND T RANSPORT I NTERPRETATION
In this Section we present the theoretical properties of Sobolev IPM and how it relates to distributions transport theory and other known metrics between distributions, notably the Stein distance.
A. D ISTRIBUTION T RANSPORT P ERSPECTIVE ON S OBOLEV IPM
In this Section, we characterize the optimal critic of the Sobolev IPM as a solution of a non linear
PDE.
The solution of the variational problem of the Sobolev IPM satisﬁes a non linear PDE that can be derived using standard tools from calculus of variations (Ekeland & Turnbull, 1983; Alaoui et al., 2016).
Theorem 3 (PDE satisﬁed by the Sobolev Critic) .
The optimal critic of Sobolev IPM f ∗ satisﬁes the following PDE:
[Equation]
Deﬁne the Stein Operator: T ( µ ) (cid:126)g ( x ) = {+
+}
[Equation]
Hence we have the following Transport Equation of P to Q :
[Equation]
Recall the deﬁnition of Stein Discrepancy :
[Equation]
Theorem 4 (Sobolev and Stein Discrepanices) .
The following inequality holds true:
[Equation]
(cid:21)(cid:12)(cid:12)(cid:12)(cid:12) ≤
[Equation]
S ( Q , µ ) (cid:124) (cid:123)(cid:122) (cid:125)
Stein Good ﬁtness of the model Q w.r.t to µ
S µ ( P , Q ) (cid:124) (cid:123)(cid:122) (cid:125)
Sobolev Distance (14)
Consider for example µ = P , and sequence Q n .
If the Sobolev distance goes S P ( P , Q n ) → 0 , the ratio r n ( x ) = Q n ( x ) P ( x ) converges in expectation (w.r.t to Q ) to 1 .
The speed of the convergence is given by the Stein Discrepancy S ( Q n , P ) .
Relation to Fokker-Planck Diffusion Equation and Particles dynamics.
Note that PDE satisifed by the Sobolev critic given in Equation (13) can be equivalently written:
[Equation]
(15) written in this form, we draw a connection with the Fokker-Planck Equation for the evolution of a density function q t that is the density of particles X t ∈ R d evolving with a drift (a velocity ﬁeld) V ( x, t ) : [Equation]
[Equation] : dX [Equation] X t
[Equation]
) dt, where the density of X 0 is given by q 0 ( x ) =
Q ( x ) ,
The Fokker-Planck Equation states that the evolution of the particles density q t satisﬁes:
[Equation]
Comparing Equation (15) and Equation (16), we identify then the gradient of Sobolev critic as a drift.
This suggests that one can deﬁne “Sobolev descent” as the evolution of particles along the gradient ﬂow:
[Equation]
∇ x f ∗ t ( X t ) dt, where the density of X 0 is given by q 0 ( x ) = Q ( x ) , where f ∗ t is the Sobolev critic between q t and P .
One can show that the limit distribution of the particles is P .
The analysis of “Sobolev descent” and its relation to Stein Descent (Liu & Wang, 2016; Liu, 2017) is beyond the scope of this paper and will be studied in a separate work.
Hence we see that the gradient of the Sobolev critic deﬁnes a transportation plan to move particles whose distribution is Q to particles whose distribution is P (See Figure 2).
This highlights the role of the gradient of the critic in the context of GAN training in term of transporting the distribution of the generator to the real distribution.
B P ROOFS
Proof of Theorem 2.
Let F P and F Q , be the cumulative distribution functions of P and Q respectively.
We have:
[Equation]
We note D = ∂ d ∂x 1 ...∂x d , and D − i =
[Equation]
, for i = 1 . . .
d .
D − i computes the d − 1 partial derivative excluding the variable i .
In the following we assume that F P , and F Q and its d derivatives exist and are continuous meaning that F P and F Q ∈ C d ( X ) .
The objective function in Equation (3) can be written as follows:
[Equation]
(for any i , since F P and F Q ∈ C
d
( X ) )
[Equation]
f vanishes at the boundary in W 1 ,
[Equation]
Let D − =
( D − 1 , . . .
, D − d ) it follows that:
[Equation]
Let us deﬁne L 2 ( X , µ ) ⊗ d the space of measurable functions from X → R d .
For g, h ∈ L 2 ( X , µ ) ⊗ d the dot product is deﬁned as follows:
[Equation]
and the norm is given :
[Equation]
We can write the objective in Equation (18) in term of the dot product in L 2 ( X , µ ) ⊗ d :
[Equation]
On the other hand the constraint in Equation (3) can be written in terms of the norm in L 2 ( X , µ ) ⊗ d :
[Equation]
Replacing the objective and constraint given in Equations (19) and (20) in Equation (3), we obtain:
[Equation]

By deﬁnition of
[Equation]
Hence we ﬁnd also that the optimal critic f ∗ satisﬁes:
[Equation]
( X [Equation] µ
[Equation]
Proof of Lemma
[Equation]
Hence we have:
[Equation]
It follows therefore that:
[Equation]
We conclude that the Sobolev IPM can be approximated in arbitrary space as long as it has enough capacity to approximate the optimal critic.
Interestingly the approximation error is measured now with the Sobolev semi-norm, while in Fisher it was measured with the Lebesgue norm. Approximations with Sobolev Semi-norms are stronger then Lebesgue norms as given by the Poincare inequality ( || f || L
[Equation] ≤ [Equation] (cid:107) f (cid:107) W 1 , 2 0 ), meaning if the error goes to zero in Sobolev sense it also goes to zero in the Lebesgue sense , but the converse is not true.
Proof of Theorem 3.
The proof follows similar arguments in the proofs of the analysis of Laplacian regularization in semi-supervised learning studied by (Alaoui et al., 2016). [Equation]
[Equation]
Note that this problem is convex in f (Ekeland & Turnbull, 1983).
Writing the lagrangian for equation (21) we get :
[Equation]
We denote (cid:0)
[Equation]
(cid:1) as µ 1 ( x ) .To get the optimal f , we need to apply KKT conditions on the above equation.
[Equation]
From the calculus of variations:
[Equation]
Now we apply integration by part and set h to be zero at boundary as in (Alaoui et al. [Equation]
We get : ˆ
[Equation]
Hence,
[Equation]
The functional derivative of L ( f, λ ) , at any test function h vanishing on the boundary:
[Equation]
Hence we have:
[Equation]
For the optimal f ∗
[Equation]
λ ∗ ﬁrst order optimality condition gives us:
[Equation]
and
[Equation]
Note that (See for example (Alaoui et al., 2016)) : div
[Equation]
since div ( ∇ x f ∗ ( x )) = ∆ 2 f ∗ ( x )
[Equation]
Hence from equation (22)
[Equation]
[Equation]
Hence f ∗ , λ ∗ satisﬁes :
[Equation]
and
[Equation]
Let us verify that the optimal critic as found in the geometric deﬁnition (Theorem 2) of Sobolev IPM that satisﬁes:
[Equation]
satisﬁes indeed the PDE.
From equation (27)
[Equation]
we want to compute ∂ 2 f ( x ) ∂x 2 i for all i : ∂ 2 f ( x )
[Equation]
Hence, ∂
[Equation]
Adding equation (28) for all
i ∈
[ d ] [Equation] we get :
[Equation]
As a result, the solution f ∗ of the partial differential equation given in equation (25) satisﬁes the following :
[Equation]
Using the constraint in (26) we can get the value of λ ∗ : ˆ
[Equation]
Proof of Theorem 4.
Deﬁne the Stein operator (Oates et al., 2017):
[Equation]
This operator was later used in deﬁning the Stein discrepancy (Gorham & Mackey, 2015;
Liu et al., 2016; Chwialkowski et al., 2016; Liu, 2017).
Recall that Barbour generator theory provides us a way of constructing such operators that produce mean zero function under µ .
It is easy to verify that:
[Equation]
Recall that this operator arises from the overdamped Langevin diffusion, deﬁned by the stochastic differential equation:
[Equation]
where ( W t ) t ≥ 0 is a Wiener process.
This is related to plug and play networks for generating samples if the distribution is known, using the stochastic differential equation.
From Theorem 3, it is easy to see that the PDE the Sobolev Critic ( f ∗ , λ ∗ =
S µ ( P , Q )) can be written in term of Stein Operator as follows:
[Equation]
Taking absolute values and the expectation with respect to Q :
[Equation]
Recall that the deﬁnition of Stein Discrepancy :
[Equation]
It follows that Sobolev IPM critic satisﬁes:
[Equation]
Hence we have the following inequality:
[Equation]
This is equivalent to:
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
Similarly we obtain:
[Equation]
[Table]
[Equation]
[Table]
[Equation] [Table] [Equation] [Table]
For instance consider µ = P
[Equation]
we have therefore:
[Equation]
( P , Q ) .
Note that the left hand side of the inequality is not the total variation distance.
Hence for a sequence Q n if the Sobolev distance goes S P ( P , Q n ) → 0 , the ratio r n ( x ) = Q n ( x ) P ( x ) converges in expectation (w.r.t to Q ) to 1 .
The speed of the convergence is given by the Stein
Discrepancy S ( Q n , P ) .
One important observation here is that convergence of PDF ratio is weaker than the conditional
CDF as given by the Sobolev distance and of the good ﬁtness of score function as given by Stein discrepancy.
C T EXT EXPERIMENTS : A DDITIONAL P LOTS
Comparison of annealed versus non annealed smoothing of P r in Sobolev GAN.
[Figure]
Sobolev GAN versus WGAN-GP with RNN.
We ﬁx the generator architecture to Resnets.
The experiments of using RNN (GRU) as the critic architecture for WGAN-GP and Sobolev is shown in Figure 7 where we used µ = µ GP for both cases.
We only apply gradient clipping to stabilize the performance without other tricks.
We can observe that using RNN degrades the performance.
We think that this is due to an optimization issue and a difﬁculty in training RNN under the GAN objective without any pre-training or conditioning.
[Figure] [Figure]
[Table]
[Figure]
D SSL: HYPERPARAMETERS AND ARCHITECTURE
For our SSL experiments on CIFAR-10, we use Adam with learning rate η = 2e − 4 , β 1 = 0 .and
β 2 = 0 .
999 , both for critic f (without BN) and Generator (with BN).
We selected λ CE
=
.from
We train all models for 350 epochs.
We used some L2 weight decay: 1e −on ω, S (i.e. all layers except last) and 1e − 3 weight decay on the last layer v .
For formulation(Fisher only) we have ρ F = 1e − 7 , modiﬁed critic learning rate η D = 1e − 4 , critic iters n c = 2 .
For formulation 2 (Sobolev + Fisher)
we have ρ F = 5e − 8 , ρ S = 2e − 8 , critic iters n c = 1 .
For the
WGAN-GP (Gulrajani et al., 2017) baseline SSL experiment we followed the original paper with critic iters n c = 5 , η G = η D = 1e − 4 , Adam β 2 =0.9 and GP weight λ GP = 10 . 0 .
Architectures are as below.
We determined λ CE = 0 .
3 to be optimal from [0 . 03 , 0 . 1 , 0 . 3 , 1 . 0 , 3 . 0] .
As mentioned in Section 6.2, the K+1 critic formulation is not able to ﬁt the training set with the GP constraint, so we fall back to the plain critic formulation where the critic [Table] v, Φ ω ( x ) (cid:105) does not interact with the classiﬁer (cid:104) S, Φ ω ( x ) (cid:105) .
Architecture:
[Table] [Table]