Projects
View on GitHub
w86763777/pytorch-gan-collections
About
PyTorch implementation of DCGAN, WGAN-GP and SNGAN.
AI & Machine LearningMeasured star growth
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalCollections of GANs
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.
Models
- DCGAN
- WGAN
- WGAN-GP
- SN-GAN
Requirements
- Install python packages
pip install -U pip setuptools pip install -r requirements.txt
Results
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 |
Examples
DCGAN
WGAN(CNN)
WGAN-GP(CNN)
WGAN-GP(ResNet)
SNGAN(CNN)
SNGAN(ResNet)
Reproduce
Download cifar10.train.npz for calculating FID. Then, create folder
statsfor the npz filesstats └── cifar10.train.npzTrain 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
Learning Curves
Change Log
2022-01-10
- Update pytorch to 1.10.1 and CUDA 11.3
- Use
pytorch_gan_metricsto 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.npzdownload link and sample images.
Explore related projects
Loading…