Now that the data is in the proper format and we have our discriminator and generator defined, we can put it all together to train our GAN. The final GAN model takes input from our target image dataset and the output is the probability that this is a real image after the real image data and the fake image data have been passed as input to the discriminator. We train our GAN model by running the following sections.
Training and evaluating the model
Defining the GAN model
We define the GAN model as follows:
- The first step that we will perform is calling the freeze_weights function on the discriminator model. This is so that the weights for the discriminator model do not update during the training process. We want the weights...