December 2019
Intermediate to advanced
468 pages
14h 28m
English
The blueprint for the CGAN implementation is very similar to the DCGAN example in the Implementing DCGAN section. That is, we'll implement CGAN in order to generate new images of the MNIST dataset. For the sake of simplicity (and diversity), we'll use fully connected generators and discriminators. To avoid repetition, we'll only show modified sections of the code compared to DCGAN. You can find the full example in this book's GitHub repository.
The first significant difference is the definition of the generator:
def build_generator(z_input: Input, label_input: Input): model = Sequential([ Dense(128, input_dim=latent_dim), LeakyReLU(alpha=0.2), BatchNormalization(momentum=0.8), Dense(256), LeakyReLU(alpha=0.2), BatchNormalization(momentum=0.8), ...
Read now
Unlock full access