Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
demo
BEGAN.py
ConditionalGAN-mnist.py
CycleGAN.py
DCGAN.py
DiscoGAN-CelebA.py
GAN.py
Image2Image.py
Improved-WGAN.py
InfoGAN-mnist.py
README.md
WGAN.py

README.md

Generative Adversarial Networks

Reproduce the following GAN-related methods, 100~200 lines each:

Please see the docstring in each script for detailed usage and pretrained models. MultiGPU training is supported.

DCGAN.py

Reproduce DCGAN following the setup in dcgan.torch.

  • Generated samples

sample

  • Vector arithmetic: smiling woman - neutral woman + neutral man = smiling man

vec

Image2Image.py

Image-to-Image translation following the setup in pix2pix.

For example, with the cityscapes dataset, it learns to generate semantic segmentation map of urban scene:

im2im

This is a visualization from tensorboard. Left to right: original, ground truth, model output.

InfoGAN-mnist.py

Reproduce the mnist experiement in InfoGAN. It assumes 10 latent variables corresponding to a categorical distribution, 2 latent variables corresponding to a uniform distribution. It then maximizes mutual information between these latent variables and the image, and learns interpretable latent representation.

infogan

  • Left: 10 latent variables corresponding to 10 digits.
  • Middle: 1 continuous latent variable controlled the rotation.
  • Right: another continuous latent variable controlled the thickness.

ConditionalGAN-mnist.py

Train a simple GAN on mnist, conditioned on the class labels.

WGAN.py, Improved-WGAN.py, BEGAN.py

These variants are implemented by some small modifications on top of DCGAN.py. Some BEGAN samples:

began-sample

CycleGAN.py, DiscoGAN-CelebA.py

Reproduce CycleGAN with the original datasets, and DiscoGAN on CelebA. They are pretty much the same idea with different architecture. CycleGAN horse-to-zebra in tensorboard:

cyclegan-sample