TensorFlow2 Implementation for vanilla GAN for generating MNIST
This repository is for the TensorFlow2 implementation for vanilla GAN. This repository provides the training module and Jupyter notebook for testing a generation of the trained models. MNIST dataset was used for this repository.
Install Python packages(Requirements). You can install them simply by using following bash command.
$ pip install -r requirements
You can use Virtualenv
, so that the packages for requirements can be managed easily. If your machine have Virtualenv
package, the following bash command would be useful.
$ virtualenv gan-mnist-tf2-venv
$ source ./gan-mnist-tf2-venv/bin/activate
$ pip install -r requirements.txt
Note: MNIST-in-CSV dataset was used for this repository. But you can use MNIST dataset module in TensorFlow. But the following process is for just using MNIST-in-CSV dataset.
Download the dataset.
The link for MNIST-in-CSV: https://www.kaggle.com/oddrationale/mnist-in-csv
Unpack the dataset.
You can check that there are two csv files named mnist_train.csv
and mnist_test.csv
.
Modify the path for dataset in config.py
.
Modify the path for directory for saving model checkpoint.
Execute training process by train.py
.
The Jupyter notebook for checking results and testing the image generation is provided. Please check result_plot.ipynb
.
Ploting the Generator and Discriminator Losses
Image Generation Results