This repository contains an implementation of Conditional Generative Adversarial Networks (cGAN) as described in the paper Conditional Generative Adversarial Nets.
Conditional GANs are an extension of GANs where both the generator and discriminator are conditioned on some extra information. This extra information could be class labels or data from other modalities. By conditioning the model on additional information, cGANs can generate more targeted and relevant outputs.
- Implementation of cGAN using PyTorch
- Training and evaluation scripts
- Example usage with Fashion MNIST dataset
- Python 3.6+
- PyTorch 1.7+
- torchvision
- numpy
- matplotlib
Clone this repository and install the required dependencies:
git clone https://github.com/momoth12/Conditional-Generative-adversarial-Networks
cd Conditional-Generative-adversarial-Networks
pip install -r requirements.txtTo train the cGAN model on Fashion MNIST dataset , run by default the following command:
python train.py I made the pipeline usable for MNIST dataset. USe
python train.py --dataset MNISTThe plot of the loss and the results are available in the generated_images and loss_plots directory.
Here are some example results generated by the cGAN model:
This implementation is inspired by the original paper and various open-source implementations available online.
