- Introduced by
- Martín Arjovsky, Soumith Chintala & Léon Bottou
- Year
- 2017
- Type
- Generative adversarial network variant
- Family
- Generative models
What does it do?
Wasserstein GAN (WGAN) is a generative adversarial network variant introduced by Arjovsky, Chintala, and Bottou in 2017.
It replaces the Jensen-Shannon divergence of the original GAN objective with the Wasserstein-1 (Earth Mover) distance, so the critic is trained to estimate a distance between real and generated distributions instead of classifying samples. The change was motivated by training instability in standard GANs. It often makes training more stable, but it does not remove instability in all settings.
The intuition behind the method
Think of the Earth Mover distance as the minimum total work needed to move a pile of earth from one shape into another. In WGAN, the critic is not a classifier: it assigns each sample an unbounded real-valued score, and the gap between its average scores on real and generated samples estimates how far apart the two distributions are. The generator is trained to shrink that gap. Because the distance remains informative even when the real and generated distributions barely overlap, the generator still receives a meaningful training signal in cases where the original GAN objective can give weak gradients.
History
WGAN was introduced by Arjovsky, Chintala, and Bottou and presented at ICML in 2017. The paper proposes the Wasserstein-1 distance, together with weight clipping, as a training objective for GANs, and it is also distributed as an arXiv preprint. Later work proposed alternatives to weight clipping for enforcing the Lipschitz condition.
When to use it
Choose WGAN when a standard GAN is unstable, for example when training oscillates or the generator collapses to a few output modes, and when a loss value that tracks sample quality is useful for monitoring training. It is a reasonable choice for image generation experiments of the kind the original paper reports. Do not expect the weight-clipped version to be the best choice when the critic must be expressive, because clipping restricts its function class. Each generator step also requires several critic updates, so training is more expensive per iteration. For a stronger Lipschitz constraint, consider the alternative enforcement methods proposed in later work and compare them with weight clipping on your task.
Limitations and considerations
- Weight clipping is a coarse approximation to the 1-Lipschitz constraint and can limit the functions the critic can represent, which may cap model capacity.
- Each generator step needs several critic updates, which raises the computational cost per training iteration.
- If the clipping constant c is poorly chosen, the critic's gradients can explode or vanish.
- The original formulation does not guarantee convergence in every setting, and later work proposed alternative ways of enforcing the Lipschitz condition.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Training is often more stable than with the original GAN objective, and the critic's loss can serve as a monitoring signal for sample quality.
- Because the critic's output is a real-valued distance estimate, the generator gets gradients even when the real and generated distributions have little overlap.
- The objective is grounded in the Wasserstein distance, a proper metric on distributions, which gives the training criterion a clear theoretical meaning.
- In some settings the formulation may reduce sensitivity to the balance between generator and critic updates, although the number of critic updates per generator update still needs tuning.
Applications
- Image generation experiments in which training stability of a GAN is the main concern.
- Distribution matching tasks where a critic-based distance estimate is used to monitor training.
How it works
How it works
The critic, a function f that must be 1-Lipschitz, is trained to maximise the difference between its average score on real samples and its average score on generated samples. By the duality stated in the mechanics formula, this difference estimates the Wasserstein-1 distance between the real and generated distributions. The critic is updated several times for every generator update so that the estimate is reasonably accurate before the generator moves.
Formula
\max_{\|f\|_L \leq 1} \; \mathbb{E}_{x \sim P_r}[f(x)] - \mathbb{E}_{\tilde{x} \sim P_g}[f(\tilde{x})]To approximate the 1-Lipschitz requirement, every critic weight is clipped to the interval [-c, c] after each critic update, where c is a positive constant. This is a coarse approximation: it keeps the weights bounded, but it can restrict which functions the critic can represent, and the choice of c affects how well the constraint works. Later work proposed alternatives to clipping for enforcing the Lipschitz condition.
Formula
w \leftarrow \mathrm{clip}(w, -c, c), \quad c \in \mathbb{R}^+The generator is trained to maximise the critic's average score on its synthetic samples, which is the same as minimising the negative expectation in the formula. Because the critic returns an unbounded real number rather than a probability, the generator receives a gradient that reflects how far its samples are from the real data.
Formula
\min_{\theta} \; -\mathbb{E}_{z \sim p(z)}[f_w(g_\theta(z))]W is the infimum, over all joint distributions (couplings) of the two distributions, of the expected cost of moving a sample from one distribution to the other, where the cost is the norm of the difference between the two samples. The Kantorovich-Rubinstein duality expresses the same quantity as a supremum over 1-Lipschitz functions, which is the form the critic approximates.
Formula
W(P_r, P_g) = \inf_{\gamma \in \Pi(P_r, P_g)} \mathbb{E}_{(x,y) \sim \gamma}[\|x - y\|]Common pitfalls
- A clipping constant c that is too large makes the Lipschitz constraint ineffective; one that is too small leaves the critic with very limited representational capacity.
- Using too few critic updates per generator update can give an inaccurate distance estimate, which weakens the link between the training objective and the Wasserstein distance.
- The critic is not a discriminator: its output is an unconstrained real number, so applying a sigmoid or softmax to it is incorrect.
- WGAN does not fully solve GAN training problems; mode dropping can still occur, particularly for highly multimodal distributions or when model capacity is limited.
Frequently asked questions
Why is the WGAN loss called the critic loss rather than the discriminator loss?
In WGAN, the network that evaluates samples outputs an unbounded real-valued score, not a probability. The term 'critic' emphasizes this distinction: it measures how real or fake a sample is on a continuous scale to approximate the Wasserstein distance, rather than classifying samples with a sigmoid output as a traditional discriminator does.
What is weight clipping and why does WGAN use it?
Weight clipping constrains all critic parameters to lie in a compact interval [-c, c] after each gradient update. This enforces the 1-Lipschitz condition required by the Kantorovich-Rubinstein duality to compute the Wasserstein distance. While effective, it is a crude constraint, and later work proposed other ways of enforcing the Lipschitz condition.
Does WGAN guarantee that the critic loss always decreases during training?
Not strictly. The critic loss estimates the Wasserstein distance, which should decrease as the generator improves. In practice, if the critic is poorly trained or the clipping constant is poorly chosen, the estimate can be noisy or biased. The theoretical guarantees hold under ideal conditions, but careful hyperparameter tuning is still required in practice.
Related methods
Sources
Arjovsky, M., Chintala, S., & Bottou, L. (2017). Wasserstein generative adversarial networks. International Conference on Machine Learning (ICML), 214–223.
Open publication reference2018_Book_NeuralNetworksAndDeepLearning, p. 474