liveBook · Manning

Mode collapse

As explained in Inside Deep Learning: Math, Algorithms, Models

A GAN failure mode in which the generator produces only a limited variety of outputs instead of covering the data distribution.

Mode collapse occurs when a GAN generator produces a narrow subset of possible outputs instead of covering the data distribution. The generator exploits an easy case—such as producing a convincing 0 repeatedly—and ignores other valid outputs. section 9.2 section 9.9

Recognize the failure through these practical signals:

  • Outputs concentrate around the most common or easiest mode, even when the target distribution contains several modes. section 9.2
  • A generator can fool the discriminator while producing little variety, because generating realistic data is harder than discriminating it. section 9.0
  • A standard GAN may miss modes in a simple nine-cluster Gaussian grid, despite having only two output variables and ample network capacity. section 9.2

Testing a GAN on a nine-mode grid

Create nine separated two-dimensional Gaussian clusters, wrap them in a PyTorch TensorDataset and DataLoader, train a GAN, and plot generated samples with a KDE. Compare the generated density with the target grid: missing circles reveal mode collapse. section 9.2

WGAN-GP reduces mode collapse rather than eliminating it. It replaces the discriminator sigmoid output, uses a gradient penalty on interpolated real and generated samples, and makes the discriminator less likely to produce unusable gradients for the generator. section 9.3 section 9.3.3

How Inside Deep Learning: Math, Algorithms, Models covers it

How deep it goes
Explains the failure mechanism, demonstrates it on a nine-mode toy distribution, and defers a complete solution.
Examples
Uses a nine-cluster Gaussian grid, KDE plots, PyTorch datasets, and WGAN-GP-generated samples to expose and reduce missing modes.
What it assumes
Builds on the adversarial game between a generator and discriminator and uses Gaussian distributions as the diagnostic setting.
What you can do after
Diagnose mode coverage with generated-sample plots and apply WGAN-GP to reduce collapse in toy and image-generation experiments.
How it connects
Connects GANs, generator–discriminator training, data distributions, vanishing gradients, Wasserstein GANs, and gradient penalties.

Also explained in

Compare how 4 books explain mode collapse →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Inside Deep Learning: Math, Algorithms, Models. The section links point to the parts of the book it draws on.