A PyTorch implementation for Goodfellow et al.'s ICML 2019 work "Self-Attention Generative Adversarial Networks". [arXiv] [PMLR]
Please install requirements by pip install -r requirements.txt
- Python 3.7
- numpy 1.17.2
- torch 1.7.1
- torchvision 0.8.2
- Pillow 6.1.0
The following libraries are optional:
- tensorboard
- tqdm
git clone https://github.com/hiyouga/SAGAN-PyTorch.git
cd SAGAN-PyTorch
python main.py --batch_size 64 --im_size 32 --dataset cifar10 --adv_loss wgan-gp
Note that the wgan-gp loss is adopted by default, since we found that the wgan-gp loss performs much better than hinge loss in our experiments.
We use the CIFAR dataset as the unsupervised training set to generate images.
Click to show the training details (visualized via TensorBoard)
For SAGAN architecture:
- Zhang et al. Self-Attention Generative Adversarial Networks. ICML. 2019.
- https://github.com/heykeetae/Self-Attention-GAN
- https://github.com/christiancosgrove/pytorch-spectral-normalization-gan
For inception score:
- Salimans et al. Improved Techniques for Training GANs. NeurIPS. 2016.
- Shane Barratt and Rishi Sharma. A Note on the Inception Score. ICML Workshop on Theoretical Foundations and Applications of Deep Generative Models. 2018.
- https://github.com/sbarratt/inception-score-pytorch
- https://github.com/w86763777/pytorch-gan-metrics
MIT