Skip to content

Pytorch implementation of DCGAN, CDCGAN, LSGAN, WGAN and WGAN-GP for CelebA dataset.

Notifications You must be signed in to change notification settings

AndrewZhuZJU/Pytorch_GAN_CelebA

Repository files navigation

Pytorch_GAN_CelebA

Pytorch implementation of DCGAN, CDCGAN, LSGAN, WGAN and WGAN-GP for CelebA dataset.

Usage

1. Download the CelebA dataset, and aligned version is used in this repo.

2. Clone the repo

$ git clone https://github.com/AndrewZhuZJU/Pytorch_GAN_CelebA.git
$ cd Pytorch_GAN_CelebA

3. Training

To train any GAN please use main_**.py. For example,

$ python main_DCGAN.py

Not that all the setting parameters for the modesl are in args.py, please change properly.

Results

Animation of generated images with fixed noise (or condition labels) during training progress

DCGAN LSGAN CGAN(Up:Male, Bottom:Female)
WGAN WGAN-GP

Generated images in Epoch 40

DCGAN LSGAN CGAN(Up:Male, Bottom:Female)
WGAN WGAN-GP

Evaluation

  • Inception score calculated in Epoch 40 (30K generated images)
DCGAN LSGAN WGAN WGAN-GP
2.10 $\pm$ 0.04 2.08 $\pm$ 0.02 2.20 $\pm$ 0.02 1.97 $\pm$ 0.02
  • Inception score calculated in Epoch 20 (30K generated images)
DCGAN LSGAN WGAN WGAN-GP
2.07 $\pm$ 0.03 1.95 $\pm$ 0.03 2.05 $\pm$ 0.02 2.00 $\pm$ 0.02

Loss Plot

Take DCGAN for example:

Generator Loss
Discriminator Loss

Development Environment

  • Ubuntu 16.04 LTS
  • NVIDIA GTX 1080 Ti
  • CUDA 9.0
  • pytorch 0.4
  • python 2.7
  • Others Dependencies: numpy, imageio, torchvision, tensorboard, etc.

References

1.Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks

2.Conditional Generative Adversarial Nets

3.Wasserstein GAN

4.Improved Training of Wasserstein GANs

5.Least Squares Generative Adversarial Networks

About

Pytorch implementation of DCGAN, CDCGAN, LSGAN, WGAN and WGAN-GP for CelebA dataset.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages