This is a PyTorch implementation of Slimmable Generative Adversarial Networks.
The code has been tested running under Python 3.6.8, with the following packages installed (along with their dependencies):
pip install -r requirements.txt
First, please enter the examples
directory .
To run the individual GANs, we give the following example script.
- SNDCGAN on CIFAR-10 with 1.0x width.
python baseline.py --dataset cifar10 --arch dcgan --width_mult_g 1.00 --width_mult_d 1.00 --setting C --n_steps 100000 --loss hinge --log_dir ./logs/gan_cifar10_dcgan_wg100_wd100
To run the SlimGAN, we give the following example scripts.
- SNResGAN (ResNet) based SlimGAN on CIFAR-10
python main.py --dataset cifar10 --arch resnet --setting G --alpha 20 --stepwise --n_share 2 --log_dir ./logs/slimgan_cifar10_resnet_alpha20_stepwise_nshare2
- cGANpd based SlimGAN on CIFAR-10
python main.py --dataset cifar10 --arch resnet --setting G --cond --alpha 10 --stepwise --n_share 2 --log_dir ./logs/slimgan_cifar10_cganpd_alpha10_stepwise_nshare2
If you use this code, please cite
@inproceedings{hou2021slimmable,
title={Slimmable Generative Adversarial Networks},
author={Hou, Liang and Yuan, Zehuan and Huang, Lei and Shen, Huawei and Cheng, Xueqi and Wang, Changhu},
booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
volume={35},
number={9},
pages={7746--7753},
year={2021}
}
This repository is developed based on mimicry and slimmable_networks.