October 2018
Intermediate to advanced
472 pages
10h 57m
English
The following function pipes the input followed by the generator, which is then followed by the discriminator to form the DCGAN architecture:
def dcgan(discriminator, generator, input_shape): # Set discriminator as non trainable before compiling GAN discriminator.trainable = False # Accepts the noised input gan_input = Input(shape=input_shape) # Generates image by passing the above received input to the generator gen_img = generator(gan_input) # Feeds the generated image to the discriminator gan_output = discriminator(gen_img) # Compile everything as a model with binary crossentropy loss gan = Model(inputs=gan_input, outputs=gan_output) return gan
If you have not seen how to use the Model function API before, please ...
Read now
Unlock full access