Based on CIFAR Dataset in Pytorch.
A generalized pytorch implementation for image generation task for any dataset, using Deep convolutional generative adversarial network and Self attention generative adversarial network. The cSAW GAN stands for conditional SAGAN implemented with Wasserstein loss.
Following are the papers: This paper on DC Gans was published in November 2015 by authors Alec Radford, Luke Metz, Soumith Chintala This paper on SA Gans was published in June 2019 by authors Han Zhang, Ian Goodfellow, Dimitris Metaxas, Augustus Odena.
| DC Gan | SA Gan | Wasserstein loss | Frechet Inception score
- DC GAN: The DC Gan is an unsupervised deep convolutional GAN which generates images based on random noise.
- cSAW GAN: The conditional Self-Attention Generative Adversarial Network (cSAGAN) generates images allowing attention-driven, long- range dependency modeling using Wasserstein loss.
- The comparison of the two algorithms is done using various metrics, but the major metric is [Frechet Inception score].
- Deep convolutional GAN
- Self attention GAN
- Python 3.5+
- PyTorch 0.3.0
- Clone the repository
$ git clone https://github.com/MicroprocessorX069/Comparison-of-DC-GANS-and-SA-GANS.git
$ cd Comparison-of-DC-GANS-and-SA-GANS
- Train For more parameter tuning, check paramters.py (i) Train
$ python python sagan_train.py --root_dir "./" --version "1.0" --batch_size 64 --imsize 64 --d_iter 10
or
$ python python dcgan_train.py --root_dir "./" --version "1.0" --batch_size 64 --nz 100
(ii) Test
$ python python dcgan_test.py
or
$ python python sagan_test.py
- The generated image is saved as 'DCGAN_test.png' or 'SAGAN_test.png'
Download the model weights as .ckpt file in "./model/" and hit the same commands to train and test with the correct root directory.
- Self Attention GANS: Improvisation in smaller parts and quality in image generation
- Spectral normalization:
- Conditional batch normalization
- FID metric: Better way to compare similarity of two images
- Modules
- Data
- Architecture
- Code structure
- Class activation mappings
- Distributed training
- Docker
- Results
- DC Gan: https://arxiv.org/abs/1511.06434
- SA Gan: https://arxiv.org/abs/1805.08318
- Wasserstein loss: https://arxiv.org/pdf/1701.07875.pdf
- Frechet Inception score: https://arxiv.org/pdf/1706.08500.pdf