Training loop

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:

  1. Load the generator by calling the img_generator() function. 
  2. 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.
  3. 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.
  4. Create a new batch of original images and masked images. Generate new fake images by feeding the batch of masked images ...

Get Python Deep Learning Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.