The MNIST dataset contains 60,000 training examples and 10,000 testing examples of 28x28 grayscale images of handwritten digits (0-9). In GANs_MNIST.ipynb
, the GAN is trained to generate synthetic images that resemble handwritten digits.
The CIFAR-10 dataset contains 60,000 32x32 color images across 10 different classes, with 50,000 images for training and 10,000 for testing. In GANs_CIFAR-10.ipynb
, the GAN is trained to generate synthetic images that resemble the CIFAR-10 dataset categories (e.g., animals, vehicles).
Each notebook follows the standard structure of a GAN:
- Generator: A neural network that takes random noise as input and generates images.
- Discriminator: A neural network that classifies images as real or fake.
- Training Loop: Alternates between training the discriminator and the generator to improve the generator’s ability to produce realistic images.
To train the GAN models, follow these steps:
- Open the notebooks in JupyterLab or Jupyter Notebook.
- Run the cells to import necessary libraries and load the dataset.
- Execute the training loop, which will iteratively update the generator and discriminator models.
- Monitor the generated images during training to observe the improvements in the generator’s output over time.
During training, the generated images are saved or displayed to monitor the quality of the GAN. The notebooks visualize the progress of generated images over multiple epochs, allowing you to observe how well the GAN learns to replicate the dataset images.
You can customize the GAN architecture by modifying the generator and discriminator models in the notebooks. Additionally, hyperparameters such as learning rate, batch size, and number of epochs can be tuned to improve performance.
- Ian Goodfellow et al., “Generative Adversarial Nets,” Advances in Neural Information Processing Systems, 2014.
- The original MNIST dataset: http://yann.lecun.com/exdb/mnist/
- The CIFAR-10 dataset: https://www.cs.toronto.edu/~kriz/cifar.html
This project is open-source and licensed under the MIT License.