This project implements a simple Generative Adversarial Network (GAN) for generating handwritten digits from the MNIST dataset using PyTorch. GANs are a class of machine learning models composed of two neural networks, the Generator and the Discriminator, which are trained simultaneously in a competitive manner. This repository contains a simple implementation of a Generative Adversarial Network (GAN) for generating handwritten digits from the MNIST dataset using PyTorch.
To run this code, ensure you have Python and pip installed. Then, install the required packages using the following command:
pip install torch torchvisionThe GAN consists of two neural networks:
- Discriminator: A neural network that distinguishes between real and fake images.
- Generator: A neural network that generates fake images to try to fool the discriminator.
- Clone the repository:
git clone <repository_url>- Navigate to the repository directory:
cd <repository_name>- Run the code:
python simple_gan.pyDuring training, the GAN produces both real and fake images. These images are visualized using TensorBoard. You can view the generated images and real images to track the training progress.