Conditional GAN (cGAN) is a type of Generative Adversarial Network (GAN) that generates images conditioned on a given input. In this problem, you will implement a cGAN that takes a class label as input and generates an image of a handwritten digit. The cGAN will consist of a generator network that takes the class label and a noise vector as input and produces an image, and a discriminator network that takes the generated image and the real image as input and outputs a probability that the generated image is real.
Example:
Suppose we have a dataset of 1000 images of handwritten digits. We want to train a cGAN to generate new images of handwritten digits conditioned on the class label.
Constraints:
Test Cases
Test Case 1
Input:
[[1, 2], [3, 4]]Expected:
NoneTest Case 2
Input:
[[5, 6], [7, 8]]Expected:
None+ 3 hidden test cases