Click4Ai

457.

Hard

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:

  • The generator network should have 5 layers with 128 units each.
  • The discriminator network should have 5 layers with 128 units each.
  • The ReLU activation function should be used for the generator and discriminator networks.
  • The Adam optimizer should be used with a learning rate of 0.001.
  • Test Cases

    Test Case 1
    Input: [[1, 2], [3, 4]]
    Expected: None
    Test Case 2
    Input: [[5, 6], [7, 8]]
    Expected: None
    + 3 hidden test cases