Search

cGAN: Conditional Generative Adversarial Nets

There are two motivations for making use of the class label information in a GAN model.
1.
Improve the GAN.
2.
Targeted Image Generation.
Generative adversarial nets can be extended to a conditional model if both the generator and discriminator are conditioned on some extra information y. […] We can perform the conditioning by feeding y into the both the discriminator and generator as additional input layer.
… by conditioning the model on additional information it is possible to direct the data generation process. Such conditioning could be based on class labels

How to Condition the input?

… we also explore a class conditional version of the model, where a vector c encodes the label. This is integrated into Gk & Dk by passing it through a linear layer whose output is reshaped into a single plane feature map which is then concatenated with the 1st layer maps. - Deep Generative Image Models using a Laplacian Pyramid of Adversarial Networks, 2015
1.
The class label is then passed through an Embedding layer with the size of 50. This means that each of the 10 classes for the Fashion MNIST dataset (0 through 9) will map to a different 50-element vector representation that will be learned by the discriminator model.
2.
The output of the embedding is then passed to a fully connected layer with a linear activation. Importantly, the fully connected layer has enough activations that can be reshaped into one channel of a 28×28 image.
결론: label (10) → FC (input size) → concat with input → G / D

Discriminator

Generator