Clone or download
Latest commit 12dcf94 Apr 17, 2018

SN-GAN (spectral normalization GAN) in PyTorch

Based on the paper "Spectral Normalization for Generative Adversarial Networks" by Takeru Miyato, Toshiki Kataoka, Masanori Koyama, Yuichi Yoshida

ICLR 2018 preprint:

CIFAR-10 Samples

with spectral normalization

Implementation Details

This code implements both DCGAN-like and ResNet GAN architectures. In addition, training with standard, Wasserstein, and hinge losses is possible.

To get ResNet working, initialization (Xavier/Glorot) turned out to be very important.


Train ResNet generator and discriminator with hinge loss: python --model resnet --loss hinge

Train ResNet generator and discriminator with wasserstein loss: python --model resnet --loss wasserstein

Train DCGAN generator and discriminator with cross-entropy loss: python --model dcgan --loss bce