liveBook · Manning

Generator loss

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

The generator objective in WGAN training, defined here as the negative discriminator score on generated samples.

In WGAN training, the generator loss measures how well generated samples score under the discriminator. It is defined as the negative discriminator score on fake samples: lossG = −D(G(z)). section 9.3.2

The formula follows directly from the opposing training goals:

  • The discriminator maximizes the score assigned to generated samples. section 9.3.2
  • The generator minimizes the sign-flipped score, so improving D(G(z)) lowers lossG. section 9.3.2
  • Only fake samples appear because the generator does not affect D(x), the discriminator score for real data. section 9.3.2

Batch calculation

Generate a batch from random vectors z, evaluate D(G(z)), average those scores, and negate the result to obtain lossG for the generator update. section 9.3.2

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

How deep it goes
Defines the reduced objective and explains its sign, but does not detail optimizer code or gradient internals.
Examples
Uses the expression −D(G(z)) and generated samples from random vectors as the concrete calculation.
What it assumes
Assumes familiarity with generators, discriminators, generated samples, and alternating adversarial updates.
What you can do after
Apply it via a negative batch-average discriminator score when updating the generator.
How it connects
Connects generator loss to WGAN, discriminator, generator, generated samples, and alternating adversarial training.

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.