DCGANs are short for Deep Convolutional Generative Adversarial Networks. These work on the same adversarial nature of the generator and discriminator, only that instead of simple model layers, Convolutions and Convolution Transpose layers are used. Here, we have implemented DCGAN in PyTorch on the MNIST Dataset.
The dataset can be downloaded from the following link
However, PyTorch does provide the facility to download the MNIST dataset in its dataset module. As done in the code, model_DCGAN.py

The model consists of a Generator and a Discriminator. The Generator generates images from a vector of random numbers from a normal distribution. The Discriminator is a CNN classifier. In a nutshell, the model's or rather the generator's objective is to generate images as similar as possible to the original images, however, it needs a feedback on its progress, this feedback is given by the Discriminator as to how good it is doing.
Note: The architecture is not generic and is hardcoded for the MNIST dataset's images.
Since the GAN is adversarial, the number of epochs will improve the model and the losses of both the Discriminator and Generator will seem to oscillate.







