A collection of generative adversarial network models, e.g. GAN, FGAN, SoftmaxGAN, LSGAN in Tensorflow.
- Command 1:
python train.py gan_name train - Command 2:
python train.py gan_name generate
Note: Generated samples will be stored in images/{gan_model}/ directory during training.
Description: The Generator is similar to a Decoder whereas the Discriminator is in the form of an Encoder.
- GAN: Generative Adversarial Networks
- Date: 2014-06
- Paper: Generative Adversarial Networks
- Loss functions (Minimization):
-
- DCGAN: Deep Convolutional GAN
- Date: 2016-01
- Paper: Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks
- Loss functions (Minimization):
-
- FGAN: f-GAN
- Date: 2016-06
- Paper: f-GAN: Training Generative Neural Samplers using Variational Divergence Minimization
- Loss functions (Minimization):
-
- SoftmaxGAN: Softmax GAN
- Date: 2017-04
- Paper: Softmax GAN
- Loss functions (Minimization):
-
- LSGAN: Least Squares GAN
- Date: 2017-04
- Paper: Least Squares Generative Adversarial Networks
- Loss functions (Minimization):
-
- WGAN: Wasserstein GAN
- Date: 2017-12
- Paper: Wasserstein GAN
- Loss functions (Minimization):
-
- WGAN_GP: Wasserstein GAN with Gradient Penalty
- Date: 2017-12
- Paper: Improved Training of Wasserstein GANs
- Loss functions (Minimization):
-
- DRAGAN: Deep Regret Analytic GAN
- Date: 2017-12
- Paper: On Convergence and Stability of GANs
- Loss functions (Minimization):
-
- BGAN: Boundary-Seeking GAN
- Date: 2018-02
- Paper: Boundary-Seeking Generative Adversarial Networks
- Loss functions (Minimization):
-
The following results can be reproduced with the command:
python train.py gan_name train
| Name | Epoch 1 | Epoch 2 | Epoch 3 |
|---|---|---|---|
| GAN | ![]() |
![]() |
![]() |
| DCGAN | ![]() |
![]() |
![]() |
| FGAN | ![]() |
![]() |
![]() |
| SoftmaxGAN | ![]() |
![]() |
![]() |
| LSGAN | ![]() |
![]() |
![]() |
| DRAGAN | ![]() |
![]() |
![]() |
| WGAN | ![]() |
![]() |
![]() |
| WGAN_GP | ![]() |
![]() |
![]() |
| BGAN | ![]() |
![]() |
![]() |
- Install miniconda https://docs.conda.io/en/latest/miniconda.html
- Create an environment
conda create --name autoencoder - Activate the environment
source activate autoencoder - Install [Tensorflow]
conda install -c conda-forge tensorflow - Install [Opencv]
conda install -c conda-forge opencv - Install [sklearn]
conda install -c anaconda scikit-learn - Install [matplotlib]
conda install -c conda-forge matplotlib
If you wanna try new dataset, please make sure you make it in the following way:
- Dataset_main_directory
- train_data
- category_1: (image1, image2, ...)
- category_2: (image1, image2, ...)
- ...
- test_data
- category_1: (image1, image2, ...)
- category_2: (image1, image2, ...)
- ...
- train_data
The loader.py file will automatically upload all images and their labels (category_i folders)
This implementation has been based on the work of the great following repositories:



























