Conditional GAN

Generating right half of an MNIST digit given the left half.

In this task, you should train a conditional GAN to generate the right half of MNIST images, given the left half.

Load the dataset

Load the MNIST dataset bellow. You can use either torchvision.datasets.MNIST or sklearn.datasets.fetch_openml() or any other way to load the dataset.

In [ ]:

Design your model

Implement your GAN below using torch.nn modules. Feel free to add extra cells. The generator should construct right half of an image given the left half of it and a noise. The general structure of this GAN is shown below.

In [ ]:

Train your GAN

Write the training process below. Feel free to add extra cells.

In [ ]:

Plot Generator/Discriminator losses

In [ ]:

Draw examples

Draw real vs. generated images below (from the best epoch).

In [ ]: