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 MNIST dataset bellow. You can use either torchvision.datasets.MNIST
or sklearn.datasets.fetch_openml()
or any other way to load the dataset.
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.
Write the training process below. Feel free to add extra cells.
Draw real vs. generated images below (from the best epoch).