Skip to content

Spectral Normalization for Keras Dense and Convolution Layers

License

Notifications You must be signed in to change notification settings

wang-zm18/SpectralNormalizationKeras

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spectral Normalization for Keras

The simple Keras implementation of ICLR 2018 paper, Spectral Normalization for Generative Adversarial Networks. [openreview][arixiv][original code(chainer)]

[Hackmd][github]

Result

CIFAR10

DCGAN architecture

10epoch With SN Without SN
With GP
Without GP
100epoch With SN Without SN
With GP
Without GP
200epoch With SN Without SN
With GP
Without GP
300epoch With SN Without SN
With GP
Without GP
400epoch With SN Without SN
With GP
Without GP
500epoch with SN without SN
With GP
Without GP
Loss with SN without SN
With GP
Without GP

ResNet architecture

10epoch With SN Without SN
With GP
Without GP
100epoch With SN Without SN
With GP
Without GP
200epoch With SN Without SN
With GP
Without GP
300epoch With SN Without SN
With GP
Without GP
400epoch With SN Without SN
With GP
Without GP
500epoch with SN without SN
With GP
Without GP
Loss with SN without SN
With GP
Without GP

How to use?

  1. Move SpectralNormalizationKeras.py in your dir
  2. Import these layer class
from SpectralNormalizationKeras import DenseSN, ConvSN1D, ConvSN2D, ConvSN3D
  1. Use these layers in your discriminator as usual

Example notebook

CIFAR10 with DCGAN architecture

CIFAR10 with ResNet architecture

Model Detail

Architecture

DCGAN

Generator

Discriminator

ResNet GAN

Generator

Generator UpSampling ResBlock

Dicriminator

Discriminator DownSampling ResBlock

Discriminator ResBlock

Issue

  • Compare with WGAN-GP
  • Projection Discriminator

Acknowledgment

  • Thank @anshkapil pointed out and @IFeelBloated corrected this implementation.

About

Spectral Normalization for Keras Dense and Convolution Layers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 88.7%
  • Python 11.3%