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 to update for the generator and not for the discriminator:
freeze_weights(discriminator)
- The next step is to define the input and output for keras_model, as we did with the generator and the discriminator. In this case, keras_model will be our final GAN model. Note here that the input will contain 100 values, which is the same as our generator, since the input to our GAN model will pass through our generator model and then continue through to our discriminator ...