Skip to content

vineetkothari23/Comparison-of-DC-GANS-and-SA-GANS

Repository files navigation

Comparison-of-DC-GANS-and-SA-GANS

Based on CIFAR Dataset in Pytorch.

About:

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.

Citations:

| DC Gan | SA Gan | Wasserstein loss | Frechet Inception score

Broader look out:

  • 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].

Images generated

Images generated by DC GAN Images generatedby SA GAN

Architecture

  1. Deep convolutional GAN

DC GAN Architecture

  1. Self attention GAN

SA GAN Architecture

Usage

Requirements

  • Python 3.5+
  • PyTorch 0.3.0

Train/ test

  1. 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
  1. 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 
  1. The generated image is saved as 'DCGAN_test.png' or 'SAGAN_test.png'

Using a pretrained model weights

Download the model weights as .ckpt file in "./model/" and hit the same commands to train and test with the correct root directory.

Documentation

Theoritical details

Implementation

Issues

Related projects

Acknowledgements

  1. DC Gan: https://arxiv.org/abs/1511.06434
  2. SA Gan: https://arxiv.org/abs/1805.08318
  3. Wasserstein loss: https://arxiv.org/pdf/1701.07875.pdf
  4. Frechet Inception score: https://arxiv.org/pdf/1706.08500.pdf

About

Based on CIFAR Dataset in Pytorch.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published