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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 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.
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.
How unrealistic it is that a forger and a critic would work together is not the point of the story.
- 4.
Of course, we are not encouraging anyone to be dishonest. It’s just a story to help you understand GANs.
- 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.
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
Rights and permissions
Copyright information
© 2022 Umberto Michelucci
About this chapter
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
DOI: https://doi.org/10.1007/978-1-4842-8020-1_11
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-8019-5
Online ISBN: 978-1-4842-8020-1
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)