Skip to content

Commit

Permalink
add MNIST examples thanks to @PhoenixDai and links for image completi…
Browse files Browse the repository at this point in the history
…on code of @bamos
  • Loading branch information
carpedm20 committed Aug 10, 2016
1 parent 1f5f18c commit 03f1038
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
DCGAN in Tensorflow
====================
# DCGAN in Tensorflow

Tensorflow implementation of [Deep Convolutional Generative Adversarial Networks](http://arxiv.org/abs/1511.06434) which is a stabilize Generative Adversarial Networks. The referenced torch code can be found [here](https://github.com/soumith/dcgan.torch).

![alt tag](DCGAN.png)

*To avoid the fast convergence of D (discriminator) network, G (generatior) network is updatesd twice for each D network update which is a different from original paper.*
* [Brandon Amos](http://bamos.github.io/) wrote an excellent [blog post](http://bamos.github.io/2016/08/09/deep-completion/) and [image completion code](https://github.com/bamos/dcgan-completion.tensorflow) based on this repo.
* *To avoid the fast convergence of D (discriminator) network, G (generatior) network is updatesd twice for each D network update which is a different from original paper.*


Online Demo
-----------
## Online Demo

[<img src="https://raw.githubusercontent.com/carpedm20/blog/master/content/images/face.png">](http://carpedm20.github.io/faces/)

[link](http://carpedm20.github.io/faces/)


Prerequisites
-------------
## Prerequisites

- Python 2.7 or Python 3.3+
- [Tensorflow](https://www.tensorflow.org/)
- [SciPy](http://www.scipy.org/install.html)
- (Optional) [Align&Cropped Images.zip](http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html) : Large-scale CelebFaces Dataset


Usage
-----
## Usage

First, download dataset with:

$ mkdir data
$ python download.py --datasets mnist
$ python download.py --datasets celebA

To train a model with celebA dataset:
To train a model with downloaded dataset:

$ python main.py --dataset mnist --is_train True
$ python main.py --dataset celebA --is_train True --is_crop True

To test with an existing model:

$ python main.py --dataset mnist
$ python main.py --dataset celebA --is_crop True

Or, you can use your own dataset (without central crop) by:
Expand All @@ -49,10 +49,11 @@ Or, you can use your own dataset (without central crop) by:
$ python main.py --dataset DATASET_NAME


Results
-------
## Results

![result](https://media.giphy.com/media/l3nW2iYprSsXtagYo/giphy.gif)
![result](assets/training.gif)

### celebA

After 6th epoch:

Expand All @@ -62,19 +63,28 @@ After 10th epoch:

![result4](assets/test_2016-01-27 15:08:54.png)

With asian face dataset (with high noises):
### Asian face dataset

![custom_result1](web/img/change5.png)

![custom_result1](web/img/change2.png)

![custom_result2](web/img/change4.png)

### MNIST

MNIST codes are written by [@PhoenixDai](https://github.com/PhoenixDai).

![mnist_result1](assets/mnist1.png)

![mnist_result2](assets/mnist2.png)

![mnist_result3](assets/mnist3.png)

More results can be found [here](./assets/) and [here](./web/img/).


Training details
----------------
## Training details

Details of the loss of Discriminator and Generator (with custom dataset not celebA).

Expand All @@ -89,7 +99,6 @@ Details of the histogram of true and fake result of discriminator (with custom d
![d__hist](assets/d__hist.png)


Author
------
## Author

Taehoon Kim / [@carpedm20](http://carpedm20.github.io/)
Binary file added assets/mnist1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/mnist2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/mnist3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/training.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 03f1038

Please sign in to comment.