3. Conditional GAN
Using the same GAN as in the previous section, a condition is imposed on both the generator and discriminator inputs. The condition is in the form of a one-hot vector version of the digit. This is associated with the image to be produced (generator) or classified as real or fake (discriminator). The CGAN model is shown in Figure 4.3.1.
CGAN is similar to DCGAN except for the additional one-hot vector input. For the generator, the one-hot label is concatenated with the latent vector before the Dense
layer. For the discriminator, a new Dense
layer is added. The new layer is used to process the one-hot vector and reshape it so that it is suitable for concatenation to the other input of the succeeding CNN layer.
Figure 4.3.1: The CGAN model is similar to DCGAN except for the one-hot vector, which is used to condition the generator and discriminator outputs
The generator learns to generate fake images from a 100-dim input vector and a specified...