Auxiliary Classifier Generative Adversarial Network (ACGAN)
This folder contains an implementation of an Auxiliary Classifier Generative Adversarial Network (ACGAN) using PyTorch. ACGAN extends the traditional GAN architecture by incorporating class information into both the generator and discriminator, allowing control over the generated samples' characteristics.
Overview
ACGANs are capable of generating high-quality images conditioned on specific classes. In addition to generating images, the discriminator in ACGAN also predicts the class labels of the generated images. This allows for more controlled and targeted image synthesis.
Usage
To use this implementation, follow these steps:
-
Clone the repository:
-
Install dependencies: Make sure you have Python 3 and pip installed. Then install the required dependencies:
This will install PyTorch, torchvision, matplotlib, and numpy. -
Train the ACGAN: Run the
ACGAN.py
script to train the ACGAN model. This will train the ACGAN on the MNIST dataset and save the trained models (G_acgan.pth
andD_acgan.pth
). -
Generate new images: After training, you can generate new images using the trained generator by running the
This script loads the trained generator model and generates a grid of sample images.test_ACGAN.py
script.
Files
ACGAN.py
: Contains the implementation of the ACGAN model, training loop, and saving of trained models.test_ACGAN.py
: Uses the trained generator to generate sample images after training.
Contributing
Contributions are welcome! If you have ideas for improvements or new features, feel free to open an issue or submit a pull request.