Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hcnoh/vanilla-gan-mnist-tensorflow2
TensorFlow2 Implementation for vanilla GAN for generating MNIST
https://github.com/hcnoh/vanilla-gan-mnist-tensorflow2
deep-learning neural-networks tensorflow2 tensorflow2-experiments tensorflow2-models
Last synced: 3 days ago
JSON representation
TensorFlow2 Implementation for vanilla GAN for generating MNIST
- Host: GitHub
- URL: https://github.com/hcnoh/vanilla-gan-mnist-tensorflow2
- Owner: hcnoh
- Created: 2019-10-15T12:10:02.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-11-21T22:31:46.000Z (almost 2 years ago)
- Last Synced: 2023-03-08T23:13:30.369Z (over 1 year ago)
- Topics: deep-learning, neural-networks, tensorflow2, tensorflow2-experiments, tensorflow2-models
- Language: Jupyter Notebook
- Homepage:
- Size: 375 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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.
![](/assets/img/README/README_2019-10-17-19-53-53.png)
## 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.```bash
$ 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.
```bash
$ virtualenv gan-mnist-tf2-venv
$ source ./gan-mnist-tf2-venv/bin/activate
$ 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](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**
![](/assets/img/README/README_2019-10-17-19-55-51.png)
2. **Image Generation Results**
![](/assets/img/README/README_2019-10-17-19-56-38.png)
## References
- GAN: [Generative Adversarial Nets](http://papers.nips.cc/paper/5423-generative-adversarial-nets)
- yunjey's PyTorch Tutorial: [PyTorch Tutorial](https://github.com/yunjey/pytorch-tutorial/blob/master/tutorials/03-advanced/generative_adversarial_network/main.py)