Video by freeCodeCamp.org · taught by Aakash N S · streamed from YouTube. All rights remain with the creator.
Lesson 7: GANs for Image Generation
About this lesson
This final session of the Deep Learning with PyTorch live course, taught by Aakash N S, turns from recognising images to creating them, with generative adversarial networks. It opens with an introduction to generative modelling, explaining how a model can learn the patterns in a collection of images well enough to produce new ones, and surveys some of the applications of GANs. The session then explains the central idea: two networks trained against each other. You build a generator, which takes a vector of random numbers and turns it into an image, and a discriminator, which looks at an image and estimates whether it is real or generated. Working with a dataset of handwritten digits, the session shows how to prepare the real images, how the generator's first outputs look like random noise and how the losses for each network are defined. The two networks are then trained together, alternating between updates that help the discriminator spot fakes and updates that help the generator fool it, and the session explains why the contest between them leads to more realistic images over time. Throughout training, sample images are saved so that the improvement of the generator can be visualised from one epoch to the next, and the results are evaluated by inspecting the generated digits. Each step is shown running live in a notebook, so that you can follow along. Afterwards, read Chapter 7 of the course book, which works the adversarial losses by hand.