liveBook · Manning

WGAN-GP

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

A Wasserstein GAN variant that adds a gradient penalty to stabilize discriminator training.

WGAN-GP stabilizes GAN training by adding a gradient penalty to the discriminator loss. It reduces opportunities for vanishing gradients and helps the generator keep up with the discriminator, addressing mode collapse. section 9.3.3

A training step follows this sequence:

  • Compute discriminator scores for real data and generated data without detaching the generated samples. section 9.3.3

Toy grid and handwritten digits

The same training function is applied first to a two-dimensional toy grid and then to 28×28 digit data, with generated samples, discriminator scores, and smoothed losses inspected afterward.

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

How deep it goes
Implements the training loop, interpolation, autograd calculation, penalty, and optimizer updates without deriving the Wasserstein objective.
Examples
Demonstrates training on a toy grid and 28×28 digit data, then visualizes samples, discriminator scores, and loss curves.
What it assumes
Assumes generator, discriminator, latent-noise, data-loader, and optimizer patterns from an ordinary GAN training loop.
What you can do after
Build and train a WGAN-GP in PyTorch for unlabeled or optionally labeled data loaders.
How it connects
Connects GANs with generators, discriminators, mode collapse, gradient penalties, and automatic differentiation.

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.