This repository contains code to generate new images from normal distribution using GAN (Generative Adversial Networks) architecture and training using FashionMNIST dataset.
GAN architectures comprises of :
- Generator - Generates images such that the discriminator finds it hard to discriminate
- Discriminator - Distinguishes between real and fake images
The project is organized as follows:
-
Import Dependencies and Data
-
Visualize Data and Build Dataset
-
Build Neural Network
3.1. Import Modelling Components
3.2 Build Generator
3.3 Build Discriminator -
Construct Training Loop
4.1 Setup Losses and Optimizers
4.2 Build Subclassed Model
4.3 Build Callback
4.4 Train
4.5 Review Performance -
Test Out the Generator
5.1 Generate Images
5.2 Save the Model
To get started with this project, follow these steps:
- Clone the repository to your local machine using the following command:
git clone https://github.com/rachitdani/GAN-Implementation-on-Fashion-MNIST-dataset.git
- Navigate to the jupyter notebook file:
cd GAN-Implementation-on-Fashion-MNIST-dataset/GAN_on_FashionMNIST_dataset.ipynb
- Create an Folder named images manually or via code :
mkdir images
- Run the Notebook file
Once you have completed the required steps you can generate new images based on the FashionMNIST dataset using the GAN architecture. The images will be availbe in the images folder and will be generated after each epoch.
I have trainied the architecture only upto 10 epochs but you can train till upto 2000 epochs to generate better images.
The kind of similar images our GAN architecture should generate from normal distribution
Generator generated images after 1 epoch from normal distribution
Generated Images after training for 10 epochs from normal distribution
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix:
git checkout -b feature-name
. - Make your changes and commit them:
git commit -m 'Description of your changes'
. - Push your changes to your fork:
git push origin feature-name
. - Create a pull request on the original repository.