项目作者: hcnoh

项目描述 :
TensorFlow2 Implementation for vanilla GAN for generating MNIST
高级语言: Jupyter Notebook
项目地址: git://github.com/hcnoh/vanilla-GAN-MNIST-tensorflow2.git
创建时间: 2019-10-15T12:10:02Z
项目社区:https://github.com/hcnoh/vanilla-GAN-MNIST-tensorflow2

开源协议:

下载


Generative Adversarial Network (GAN) Implementation for Generating MNIST Images in TensorFlow2

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 Dependencies

  1. Install Python 3.5.2.
  2. Install TensorFlow ver 2.0.0. If you can use a GPU machine, install the GPU version of TensorFlow, or just install the CPU version of it.
  3. Install Python packages(Requirements). You can install them simply by using following bash command.

    1. $ 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.

    1. $ virtualenv gan-mnist-tf2-venv
    2. $ source ./gan-mnist-tf2-venv/bin/activate
    3. $ pip install -r requirements.txt

Training

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.

  1. Download the dataset.

    The link for MNIST-in-CSV: https://www.kaggle.com/oddrationale/mnist-in-csv

  2. Unpack the dataset.

    You can check that there are two csv files named mnist_train.csv and mnist_test.csv.

  3. Modify the path for dataset in config.py.

  4. Modify the path for directory for saving model checkpoint.

  5. Execute training process by train.py.

Checking Results and Testing Generation

The Jupyter notebook for checking results and testing the image generation is provided. Please check result_plot.ipynb.

Results

  1. Ploting the Generator and Discriminator Losses

  2. Image Generation Results

References