The Wasserstein Generative Adversarial Network (WGAN) is a variant of generative adversarial network (GAN) proposed in 2017 that aims to "improve the stability of learning, get rid of problems like mode collapse, and provide meaningful learning curves useful for debugging and hyperparameter searches". Compared with the original GAN discriminator, the Wasserstein GAN discriminator provides a better learning signal to the generator. This allows the training to be more stable when generator is learning distributions in very high dimensional spaces.
Motivation
The GAN game The original GAN method is based on the GAN game, a zero-sum game with 2 players: generator and discriminator. The game is defined over a probability space (Ω,ℬ,μref), The generator's strategy set is the set of all probability measures μG on (Ω,ℬ), and the discriminator's strategy set is the set of measurable functions D:Ω→[0,1]. The objective of the game isL(μG,D):=𝔼x∼μref[lnD(x)]+𝔼x∼μG[ln(1−D(x))]. The generator aims to minimize it, and the discriminator aims to maximize it.
A basic theorem of the GAN game states that Repeat the GAN game many times, each time with the generator moving first, and the discriminator moving second. Each time the generator μG changes, the discriminator must adapt by approaching the idealD∗(x)=dμrefd(μref+μG). Since we are really interested in μref, the discriminator function D is by itself rather uninteresting. It merely keeps track of the likelihood ratio between the generator distribution and the reference distribution. At equilibrium, the discriminator is just outputting 12 constantly, having given up trying to perceive any difference. Concretely, in the GAN game, let us fix a generator μG, and improve the discriminator step-by-step, with μD,t being the discriminator at step t. Then we (ideally) haveL(μG,μD,1)≤L(μG,μD,2)≤⋯≤maxμDL(μG,μD)=2DJS(μref‖μG)−2ln2,so we see that the discriminator is actually lower-bounding DJS(μref‖μG).
Wasserstein distance Thus, we see that the point of the discriminator is mainly as a critic to provide feedback for the generator, about "how far it is from perfection", where "far" is defined as Jensen–Shannon divergence. Naturally, this brings the possibility of using a different criteria of farness. There are many possible divergences to choose from, such as the f-divergence family, which would give the f-GAN. The Wasserstein GAN is obtained by using the Wasserstein metric, which satisfies a "dual representation theorem" that renders it highly efficient to compute:
A proof can be found in the main page on Wasserstein metric.
Definition By the Kantorovich-Rubenstein duality, the definition of Wasserstein GAN is clear:A Wasserstein GAN game is defined by a probability space (Ω,ℬ,μref), where Ω is a metric space, and a constant K>0. There are 2 players: generator and discriminator (also called "critic"). The generator's strategy set is the set of all probability measures μG on (Ω,ℬ). The discriminator's strategy set is the set of measurable functions of type D:Ω→ℝ with bounded Lipschitz-norm: ‖D‖L≤K. The Wasserstein GAN game is a zero-sum game, with objective functionLWGAN(μG,D):=𝔼x∼μG[D(x)]−𝔼x∼μref[D(x)].
The generator goes first, and the discriminator goes second. The generator aims to minimize the objective, and the discriminator aims to maximize the objective:minμGmaxDLWGAN(μG,D). By the Kantorovich-Rubenstein duality, for any generator strategy μG, the optimal reply by the discriminator is D∗, such that LWGAN(μG,D∗)=K⋅W1(μG,μref).Consequently, if the discriminator is good, the generator would be constantly pushed to minimize W1(μG,μref), and the optimal strategy for the generator is just μG=μref, as it should.
Comparison with GAN In the Wasserstein GAN game, the discriminator provides a better gradient than in the GAN game. Consider for example a game on the real line where both μG and μref are Gaussian. Then the optimal Wasserstein critic DWGAN and the optimal GAN discriminator D are plotted as below:
For fixed discriminator, the generator needs to minimize the following objectives:
For GAN, 𝔼x∼μG[ln(1−D(x))]. For Wasserstein GAN, 𝔼x∼μG[DWGAN(x)]. Let μG be parametrized by θ, then we can perform stochastic gradient descent by using two unbiased estimators of the gradient:∇θ𝔼x∼μG[ln(1−D(x))]=𝔼x∼μG[ln(1−D(x))⋅∇θlnρμG(x)]∇θ𝔼x∼μG[DWGAN(x)]=𝔼x∼μG[DWGAN(x)⋅∇θlnρμG(x)]where we used the reparameterization trick.
As shown, the generator in GAN is motivated to let its μG "slide down the peak" of ln(1−D(x)). Similarly for the generator in Wasserstein GAN. For Wasserstein GAN, DWGAN has gradient 1 almost everywhere, while for GAN, ln(1−D) has flat gradient in the middle, and steep gradient elsewhere. As a result, the variance for the estimator in GAN is usually much larger than that in Wasserstein GAN. See also Figure 3 of. The problem with DJS is much more severe in actual machine learning situations. Consider training a GAN to generate ImageNet, a collection of photos of size 256-by-256. The space of all such photos is ℝ2562, and the distribution of ImageNet pictures, μref, concentrates on a manifold of much lower dimension in it. Consequently, any generator strategy μG would almost surely be entirely disjoint from μref, making DJS(μG‖μref)=+∞. Thus, a good discriminator can almost perfectly distinguish μref from μG, as well as any μG′ close to μG. Thus, the gradient ∇μGL(μG,D)≈0, creating no learning signal for the generator. Detailed theorems can be found in.
Training Wasserstein GANs Training the generator in Wasserstein GAN is just gradient descent, the same as in GAN (or most deep learning methods), but training the discriminator is different, as the discriminator is now restricted to have bounded Lipschitz norm. There are several methods for this.
… excerpt ends here. Continue reading the full article.

