VanillaGAN-TensorFlow
November 20, 2018 · View on GitHub
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
- Structure for MNIST dataset
- Structure for CIFAR10 dataset
Generated Numbers
- MNIST
- 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:0batch_size: batch size for one feed forward, default:512dataset: dataset name for choice [mnist|cifar10], default:mnistis_train: 'training or inference mode, default:Falselearning_rate: initial learning rate, default:0.0002beta1: momentum term of Adam, default:0.5z_dim: dimension of z vector, default:100iters: number of interations, default:200000print_freq: print frequency for loss, default:100save_freq: save frequency for model, default:10000sample_freq: sample frequency for saving image, default:500sample_size: sample size for check generated image quality, default:64load_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
- Some readme formatting was borrowed from Logan Engstrom
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.