Pytorch implementation of basic unsupervised GANs on CIFAR10.
For more defails about calculating Inception Score and FID using pytorch can be found here pytorch_gan_metrics.
- DCGAN
- WGAN
- WGAN-GP
- SN-GAN
- Install python packages
pip install -U pip setuptools pip install -r requirements.txt
The FID is calculated by 50k generated images and CIFAR10 train set.
Model | Dataset | Inception Score | FID |
---|---|---|---|
DCGAN | CIFAR10 | 6.01(0.05) | 42.72 |
WGAN(CNN) | CIFAR10 | 6.62(0.09) | 40.03 |
WGAN-GP(CNN) | CIFAR10 | 7.66(0.10) | 19.83 |
WGAN-GP(ResNet) | CIFAR10 | 7.95(0.14) | 16.95 |
SNGAN(CNN) | CIFAR10 | 7.84(0.12) | 17.81 |
SNGAN(ResNet) | CIFAR10 | 8.31(0.10) | 14.32 |
-
Download cifar10.train.npz for calculating FID. Then, create folder
stats
for the npz filesstats └── cifar10.train.npz
-
Train from scratch
Different methods are separated into different files for clear reading.
# DCGAN python dcgan.py --flagfile ./configs/DCGAN_CIFAR10.txt # WGAN(CNN) python wgan.py --flagfile ./configs/WGAN_CIFAR10_CNN.txt # WGAN-GP(CNN) python wgangp.py --flagfile ./configs/WGANGP_CIFAR10_CNN.txt # WGAN-GP(ResNet) python wgangp.py --flagfile ./configs/WGANGP_CIFAR10_RES.txt # SNGAN(CNN) python sngan.py --flagfile ./configs/SNGAN_CIFAR10_CNN.txt # SNGAN(ResNet) python sngan.py --flagfile ./configs/SNGAN_CIFAR10_RES.txt
-
2022-01-10
- Update pytorch to 1.10.1 and CUDA 11.3
- Use
pytorch_gan_metrics
to calculate FID and Inception Score - Use 50k generated images and CIFAR10 train set to calculate FID
- Fix default parameters especially for
wgan.py
-
2021-04-16
- Update pytorch to 1.8.1
- Move metrics to submodule.
- Evaluate FID on CIFAR10 test set instead of training set.
- Fix
cifar10.test.npz
download link and sample images.