Now we are at the most important part of the code; the part where all of the functions we previously defined will be used. The following are the steps:
- Load the generator by calling the img_generator() function.
- Load the discriminator by calling the img_discriminator() function and compile it with the binary cross-entropy loss and optimizer as optimizer_d, which we have defined under the hyperparameters section.
- Feed the generator and the discriminator to the dcgan() function and compile it with the binary cross-entropy loss and optimizer as optimizer_g, which we have defined under the hyperparameters section.
- Create a new batch of original images and masked images. Generate new fake images by feeding the batch of masked images ...