We've got a generator and a discriminator—that's all we need, right? Not so fast. We need to actually create the adversarial model. Also, there is an open ended question about why are we not focusing more on the loss function. In this case, each of the loss functions are built into the Keras library, so we aren't going to focus heavily on that aspect right now. When we cover more complex models, the loss functions will need to be customized, and that will require more explanation. For now, let's keep our focus on how to structure a basic GAN and how we can train it in an adversarial manner.
Putting all the GAN pieces together
Getting ready
All of this code will be put into the gan.py file under...