liveBook · Manning

Generative adversarial network

As explained in Evolutionary Deep Learning: Genetic algorithms and neural networks

A generative adversarial network is a model consisting of a generator and discriminator trained in opposition to produce realistic synthetic data.

A generative adversarial network (GAN) is a generative model built from two competing networks: a generator creates synthetic data, while a discriminator classifies samples as real or fake. Their opposition can produce realistic representations, but training is notoriously difficult because both networks must improve at roughly the same rate. section 9.1.1 section 9.6

The generator receives a randomized latent space with added noise and produces samples. The discriminator sees real samples alongside generated samples, learns from its prediction feedback, and supplies feedback that helps the generator produce more convincing outputs. If either network learns substantially faster, the adversarial relationship can break down. section 9.1.1 section 9.2

Inspect these recognizable training artifacts when diagnosing a GAN:

  • Vanishing gradients occur when an overly strong discriminator provides too little loss feedback for useful generator updates. section 9.2.1
  • Mode collapse occurs when the generator repeatedly produces nearly the same output with little variation. section 9.2.1
  • Failure to converge occurs when the generator improves too quickly and overwhelms the discriminator, reducing its predictions to random guesses. section 9.2.1

Training and experimenting with a basic GAN

Implement a basic GAN with Python and Keras, train it to generate realistic digits from a chosen class, then vary batch size, generator and discriminator learning rates, or dataset class selection. Extend the experiment by evolving training hyperparameters, reusing an evolved model on a similarly sized dataset, or testing evolutionary strategies and differential evolution. section 9.1.3 section 9.5.1 section 9.6

Figure 9.1 Classic explanation of a GAN

Use the art-forger and art-detective diagram to visualize how generated fakes challenge the discriminator while its feedback trains the generator. section 9.1.1

How Evolutionary Deep Learning: Genetic algorithms and neural networks covers it

How deep it goes
Explains network roles, feedback, implementation, artifacts, and experiments, but stops short of extensive mathematical derivation.
Examples
Demonstrates art forgery, class-specific handwritten digits, face classification, and experiments with GAN hyperparameters and datasets.
What it assumes
Introduces the basic GAN from an art-forger analogy and reviews its operation before implementation; assumes no further prerequisite explicitly.
What you can do after
Build it from scratch with Python and Keras, inspect training failures, and experiment with evolutionary hyperparameter optimization.
How it connects
Connects generative modeling with latent space, classifiers, Wasserstein loss, genetic algorithms, and evolutionary optimization.

Also explained in

Compare how 12 books explain generative adversarial network →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Evolutionary Deep Learning: Genetic algorithms and neural networks. The section links point to the parts of the book it draws on.