This is a Unofficial TF2.0 implementation of Spectral Normalization for Generative Adversarial Networks and cGANs with Projection Discriminator.
Official implementation is available here
There are Food-101and MNIST training examples.
I found that it is easier to train 128 * 128 resolutions with dataset which has fewer classes and more examples. For example, I failed to train 64 * 64 res model with tiny-image-net(200 classes with 500 images in each classes) and stanford-dogs(120 classes with 20,580 images). However, I can get relative good result in Foods-101(101 classes and 101,000 images)
- Python 3
- jupyter or jupyterlab
- numpy
- matplotlib
- tensorflow 2.0
-
Download the dataset you want.
-
Clone this repo, then use Juypter Notebook or Lab to open the
*.ipynb
file. -
Modify the
DATASET_PATH
, and the parts with Needs to be modified in the Prepare dataset section.
Foods:
- 128 * 128 resolutions
- batch size: 16
- noise dimension: 128
- 430k iterations
MNIST
- 28 * 28 resolutions
- batch size: 64
- noise dimension: 100
- 100k iterations
Official implementation, https://github.com/pfnet-research/sngan_projection
crcrpar's repo, https://github.com/crcrpar/pytorch.sngan_projection