Skip to main content

Generative Adversarial Networks (GANs)

  • Chapter
  • First Online:
Applied Deep Learning with TensorFlow 2
  • 2202 Accesses

Abstract

Generative Adversarial Networks (GANs) are, in their most basic form, two neural networks that teach each other how to solve a specific task. The idea was invented by Goodfellow and colleagues in 2014. The two networks help each other with the final goal of being able to generate new data that looks like the data used for training. For example, you may want to train a network to generate human faces that are as realistic as possible. In this case, one network will generate human faces as good as it can, and the second network will criticize the results and tell the first network how to improve upon the faces. The two networks learn from each other, so to speak. This chapter looks in detail at how this works and explains how to implement an easy example in Keras.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Goodfellow, Ian; Pouget-Abadie, Jean; Mirza, Mehdi; Xu, Bing; Warde-Farley, David; Ozair, Sherjil; Courville, Aaron; Bengio, Yoshua (2014).”Generative Adversarial Nets” PDF). Proceedings of the International Conference on Neural Information Processing Systems (NIPS 2014). pp. 2672–2680.

  2. 2.

    We use the generic term observation. They could be fake faces, if you are trying to build a system that generates realistic faces, or an aged version of a face for example. We call an observation one of the inputs in the training dataset.

  3. 3.

    How unrealistic it is that a forger and a critic would work together is not the point of the story.

  4. 4.

    Of course, we are not encouraging anyone to be dishonest. It’s just a story to help you understand GANs.

  5. 5.

    At this point in the book, you should know the MNIST dataset very well. In case you don’t remember, it is a dataset with 70,000 handwritten digits saved as gray-level images 28x28 pixels in resolution.

  6. 6.

    If you have never seen a custom training loop, check out Appendix B, which explains the basics of customizing Keras.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2022 Umberto Michelucci

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Michelucci, U. (2022). Generative Adversarial Networks (GANs). In: Applied Deep Learning with TensorFlow 2. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-8020-1_11

Download citation

Publish with us

Policies and ethics