Skip to content

Latest commit

 

History

History
112 lines (94 loc) · 3.98 KB

README.md

File metadata and controls

112 lines (94 loc) · 3.98 KB

VanillaGAN-TensorFlow

This repository is a Tensorflow implementation of Ian J. Goodfellow's Generative Adversarial Nets, NIPS2014.

Requirements

  • tensorflow 1.8.0
  • python 3.5.3
  • numpy 1.14.2
  • pillow 5.0.0
  • pickle 0.7.4

Applied GAN Structure

  1. Structure for MNIST dataset

  1. Structure for CIFAR10 dataset

Generated Numbers

  1. MNIST

  1. CIFAR10
  • Note: The following generated results are very bad. One reason is that we applied a shallow network, 3 fully connected network, and another reason maybe the big image dimension. The generated image size is 32x32x3.

Documentation

Download Dataset

MNIST and CIFAR10 dataset will be downloaded automatically if in a specific folder there are no dataset.

Directory Hierarchy

.
├── src
│   ├── cache.py
│   ├── cifar10.py
│   ├── dataset.py
│   ├── dataset_.py
│   ├── download.py
│   ├── main.py
│   ├── solver.py
│   ├── tensorflow_utils.py
│   ├── utils.py
│   └── vanillaGAN.py

src: source codes of vanillaGAN

Training Vanilla GAN

Use main.py to train a vanilla GAN network. Example usage:

python main.py --is_train true
  • gpu_index: gpu index, default: 0
  • batch_size: batch size for one feed forward, default: 512
  • dataset: dataset name for choice [mnist|cifar10], default: mnist
  • is_train: 'training or inference mode, default: False
  • learning_rate: initial learning rate, default: 0.0002
  • beta1: momentum term of Adam, default: 0.5
  • z_dim: dimension of z vector, default: 100
  • iters: number of interations, default: 200000
  • print_freq: print frequency for loss, default: 100
  • save_freq: save frequency for model, default: 10000
  • sample_freq: sample frequency for saving image, default: 500
  • sample_size: sample size for check generated image quality, default: 64
  • load_model: folder of save model that you wish to test, (e.g. 20180704-1736). default: None

Evaluate Vanilla GAN

Use main.py to evaluate a vanilla GAN network. Example usage:

python main.py --is_train false --load_model folder/you/wish/to/test/e.g./20180704-1746

Please refer to the above arguments.

Citation

  @misc{chengbinjin2018vanillagan,
    author = {Cheng-Bin Jin},
    title = {Vanilla GAN},
    year = {2018},
    howpublished = {\url{https://github.com/ChengBinJin/VanillaGAN-TensorFlow}},
    note = {commit xxxxxxx}
  }

Attributions/Thanks

License

Copyright (c) 2018 Cheng-Bin Jin. Contact me for commercial use (or rather any use that is not academic research) (email: sbkim0407@gmail.com). Free for research use, as long as proper attribution is given and this copyright notice is retained.

Related Projects