This chapter covers
- Building generator and discriminator networks in generative adversarial networks from scratch
- Using GANs to generate data points to form shapes (e.g., exponential growth curve)
- Generating integer sequences that are all multiples of 5
- Training, saving, loading, and using GANs
- Evaluating GAN performance and determining training stop points
Close to half of the generative models in this book belong to a category called generative adversarial networks (GANs). The method was first proposed by Ian Goodfellow and his coauthors in 2014.1 GANs, celebrated for their ease of implementation and versatility, empower individuals with even rudimentary knowledge of deep learning to construct their models from the ground up. The word “adversarial” in GAN refers to the fact that the two neural networks compete against each other in a zero-sum game framework. The generative network tries to create data instances indistinguishable from real samples. In contrast, the discriminative network tries to identify the generated samples from real ones. These versatile models can generate various content formats, from geometric shapes and sequences of numbers to high-resolution color images and even realistic-sounding musical compositions.