This is the official implementation of PE-GANs
- Python 3.9.0
- Python packages
# update `pip` for installing tensorboard. pip install -U pip setuptools pip install -r requirements.txt
-
CIFAR-10
Pytorch build-in CIFAR-10 will be downloaded automatically.
-
STL-10
Pytorch build-in STL-10 will be downloaded automatically.
Pre-calculated statistics for FID can be downloaded here:
- cifar10.train.npz - Training set of CIFAR10
- cifar10.test.npz - Testing set of CIFAR10
- stl10.unlabeled.48.npz - Unlabeled set of STL10 in resolution 48x48
Folder structure:
./stats
├── cifar10.test.npz
├── cifar10.train.npz
└── stl10.unlabeled.48.npz
NOTE
All the reported values (Inception Score and FID) in our paper are calculated by official implementation instead of our implementation.
-
Configuration files
-
We use
absl-py
to parse, save and reload the command line arguments. -
All the configuration files can be found in
./config
. -
The compatible configuration list is shown in the following table:
Script Configurations trainPEGAN.py
PEGAN_P5_CIFAR10_CNN.txt
PEGAN_P5_STL10_CNN.txt
PEGAN_P10_CIFAR10_CNN.txt
PEGAN_P10_STL10_CNN .txt
trainSNGAN.py
SNGAN_CNN_CIFAR10.txt
trainWGAN.py
WGAN_CNN_CIFAR10.txt
trainWGANGP.py
WGAN_GP_CNN_CIFAR10.txt
-
-
Run the training script with the compatible configuration, e.g.,
trainPEGAN.py
supports training gan onCIFAR10
andSTL10
, e.g.,python trainPEGAN.py \ --flagfile ./config/PEGAN_P10_CIFAR10_CNN.txt
-
Generate images from checkpoints, e.g.,
--eval
: evaluate best checkpoint.--save PATH
: save the generated images toPATH
python train.py \ --flagfile ./logs/PEGAN_P10_CIFAR10_CNN/flagfile.txt \ --eval \ --save path/to/generated/images
Pytorch framework from GNGAN.