Giter Club home page Giter Club logo

dcgan-tensorflow's Introduction

DCGAN-TensorFlow

This repository is a Tensorflow implementation of Alec Radford's Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks, ICLR2016.

Requirements

  • tensorflow 1.9.0
  • python 3.5.3
  • numpy 1.14.2
  • pillow 5.0.0
  • pickle 0.7.4
  • scipy 0.19.0
  • matplotlib 2.0.2

Applied GAN Structure

  1. Generator

  1. Discriminator

Generated Images

  1. MNIST

  1. CIFAR10

  1. CelebA

Documentation

Download Dataset

MNIST and CIFAR10 dataset will be downloaded automatically if in a specific folder there are no dataset. Use the following command to download CelebA dataset and copy the `CelebA' dataset on the corresponding file as introduced in Directory Hierarchy information.

python download2.py celebA

Directory Hierarchy

.
│   DCGAN
│   ├── src
│   │   ├── cache.py
│   │   ├── cifar10.py
│   │   ├── dataset.py
│   │   ├── dataset_.py
│   │   ├── download.py
│   │   ├── main.py
│   │   ├── solver.py
│   │   ├── tensorflow_utils.py
│   │   ├── utils.py
│   │   └── dcgan.py
│   Data
│   ├── celebA
│   ├── cifar10
│   └── mnist

src: source codes of the DCGAN

Implementation Details

Implementation uses TensorFlow implementation to train the DCGAN. Same generator and discriminator networks are used as described in Alec Radford's paper, except that batch normalization of training mode is used in training and test mode that we found to get more stalbe results.

Training DCGAN

Use main.py to train a DCGAN network. Example usage:

python main.py --is_train=true
  • gpu_index: gpu index, default: 0
  • batch_size: batch size for one feed forward, default: 256
  • dataset: dataset name for choice [mnist|cifar10|celebA], 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 DCGAN

Use main.py to evaluate a DCGAN 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{chengbinjin2018dcgan,
    author = {Cheng-Bin Jin},
    title = {DCGAN-tensorflow},
    year = {2018},
    howpublished = {\url{https://github.com/ChengBinJin/DCGAN-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: [email protected]). Free for research use, as long as proper attribution is given and this copyright notice is retained.

Related Projects

dcgan-tensorflow's People

Contributors

chengbinjin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.