Skip to content

shikhharsiingh/DCGAN-PyTorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DCGAN-PyTorch

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.

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
/images/sample.png

Model

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.

Model Architecture

/images/model_desc.png

Note: The architecture is not generic and is hardcoded for the MNIST dataset's images.

Training

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.

Training...

/images/train_visuals.png

Results

After training for 20 epochs

/images/20epochs.png
/images/20ep_res.png

After training for 50 epochs

/images/50epochs.png
/images/50ep_res.png

After training for 100 epochs

/images/100epochs.png
/images/100ep_res.png

About

This repository contains the implementation of DCGAN in PyTorch.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors