Skip to content

Samuel-Bachorik/Deep_Convolutional_GAN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deep convolutional Generative Adversarial Network

Neural network generating hand written numbers

Custom model trained with custom data loader

Model

  • Fully convolutional, no Linear (Fully contected) layers
  • Generator with 6x TransposeConv, batchnorm, ReLu activation
  • Discriminator with 6x Conv2d, batchnorm, Leaky ReLu activation with 0.2 negative_slope
  • Orthogonal weight init with 0.1 gain
  • Zero bias init
  • Trained on NVIDIA RTX 3060

Loss function

Instead of the usual BCE function, I used BCEWithLogitsLoss for better numerical stability.
Loss formula -
Loss

The course of the loss function

From this figure we can see that 50 epoch is enough for these models. Generator can not get any better.
For better results you should try wasserstein loss for example. But i think for this aplication this is enough

LossGraph

Result

Fully generated hand digits from Generator neural network

LossGraph

How to use

Download dataset here - Dataset
In run_training.py change path to dataset.
Run run_training.py.

About

Neural network generating hand written numbers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages