tree: e48ed4f2859eb6df33742e7326ed19c3cbff196d [path history] [tgz]
  1. data.py
  2. model.py
  3. README.md
  4. sn_gan_output.png
  5. train.py
  6. utils.py
example/gluon/sn_gan/README.md

Spectral Normalization GAN

This example implements Spectral Normalization for Generative Adversarial Networks based on CIFAR10 dataset.

Usage

Example runs and the results:

python train.py --use-gpu --data-path=data
  • Note that the program would download the CIFAR10 for you

python train.py --help gives the following arguments:

optional arguments:
  -h, --help            show this help message and exit
  --data-path DATA_PATH
                        path of data.
  --batch-size BATCH_SIZE
                        training batch size. default is 64.
  --epochs EPOCHS       number of training epochs. default is 100.
  --lr LR               learning rate. default is 0.0001.
  --lr-beta LR_BETA     learning rate for the beta in margin based loss.
                        default is 0.5.
  --use-gpu             use gpu for training.
  --clip_gr CLIP_GR     Clip the gradient by projecting onto the box. default
                        is 10.0.
  --z-dim Z_DIM         dimension of the latent z vector. default is 100.

Result

SN-GAN

Learned Spectral Normalization

alt text

Reference

Simple Tensorflow Implementation