Skip to content

Pytorch implementation of DCGAN, WGAN-CP, WGAN-GP

Notifications You must be signed in to change notification settings

iskangkang/pytorch-wgan

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pytorch code for GAN models

This is the pytorch implementation of 3 different GAN models using same convolutional architecture.

  • DCGAN (Deep convolutional GAN)
  • WGAN-CP (Wasserstein GAN using weight clipping)
  • WGAN-GP (Wasserstein GAN using gradient penalty)

Dependecies

The prominent packages are:

  • numpy
  • scikit-learn
  • tensorflow 1.5.0
  • pytorch 0.3.0
  • torchvision 0.3.0

To install all the dependencies quickly and easily you should use pip

pip install -r requirements.txt

Training

Running training of DCGAN model on Fashion-MNIST dataset:

python main.py --model DCGAN \
               --is_train True \
               --download True \
               --dataroot datasets/fashion-mnist \
               --dataset fashion-mnist \
               --epochs 30 \
               --cuda True \
               --batch_size 64

Running training of WGAN-GP model on CIFAR-10 dataset:

python main.py --model WGAN-GP \
               --is_train True \
               --download True \
               --dataroot datasets/cifar \
               --dataset cifar \
               --generator_iters 40000 \
               --cuda True \
               --batch_size 64

Start tensorboard:

tensorboard --logdir ./logs/

Walk in latent space

Interpolation between a two random latent vector z over 10 random points, shows that generated samples have smooth transitions.

         

Generated examples MNIST, Fashion-MNIST, CIFAR-10

Inception score

About Inception score

         

Useful Resources

About

Pytorch implementation of DCGAN, WGAN-CP, WGAN-GP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%