This project implements a Generative Adversarial Network (GAN) from scratch to generate handwritten digits using the MNIST dataset.
Generator: Generates new data samples. Discriminator: Evaluates whether a given data sample is real (from the training data) or fake (generated by the generator). The two networks are trained together in a zero-sum game: the generator tries to fool the discriminator, while the discriminator aims to accurately distinguish real from fake data. A GAN consists of the following key components: Noise Vector: A random input vector fed into the generator. Generator: A neural network that transforms the noise vector into a data sample. Discriminator: A neural network that classifies input data as real or fake.
src/
: Contains the main implementation codeoutputs/
: Stores generated images during trainingnotebooks/
: Contains exploratory analysis (if any)
- Python 3.6+
- Keras
- NumPy
- Matplotlib
pip install -r requirements.txt
## Usage
To train the model:
python src/train.py
## Results
The model generates handwritten digits after training. Sample outputs are stored in the outputs/ directory.