Code for our CVPR 2020 paper "AdversarialNAS: Adversarial Neural Architecture Search for GANs".
Contributed by Chen Gao, Yunpeng Chen, Si Liu, Zhenxiong Tan, Shuicheng Yan.
We propose a novel AdversarialNAS method, which is the first gradient-based fully differentiable NAS method in GAN field and achieves state-of-art performance with much higher efficiency. We also design a large architecture search space for GAN and make it feasible to search in.
- Searched architecture of generative model on CIFAR-10 dataset.
- Re-trained generative models on CIFAR-10 and STL-10.
- Inference codes for evaluation.
- Training codes for the searched architectures.
- Searching codes.
-
Clone this repository.
git clone https://github.com/chengaopro/AdversarialNAS.git
-
Install pytorch 1.1.0, tensorflow 1.9.0, CUDA 9.0 and corresponding CUDNN via conda.
conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=9.0 -c pytorch
conda install tensorflow-gpu==1.9.0 cudnn
-
Install the requirements via pip.
pip install -r requirements.txt
Files can be found in Google Drive and Baidu Drive (passcode: bk1m).
-
Download the pre-calculated statistics to ./fid_stat for calculating the FID.
mkdir fid_stat
-
Download the inception model to ./tmp for calculating the IS and FID.
mkdir tmp
New features
- Better performance
- Supporting Amended Gradient Estimation
-
Train the weights of generative model with the searched architecture (the architecture is saved in ./exps/arch_cifar10/Genotypes/latest_G.npy)
sh scripts/train_arch_cifar10.sh
or
sh scripts/train_arch_stl10.sh
-
Download the two trained generative models (Google Drive and Baidu Drive (passcode: bk1m)) to ./exps/arch_train_cifar10/Model and ./exps/arch_train_stl10/Model respectively.
mkdir -p exps/arch_train_cifar10/Model exps/arch_train_stl10/Model
-
Test the trained model
sh scripts/test_arch_cifar10.sh
or
sh scripts/test_arch_stl10.sh
Please consider citing our paper in your publications if it helps your research. The following is a BibTeX reference. The BibTeX entry requires the url LaTeX package.
@InProceedings{Gao_2020_CVPR,
author = {Gao, Chen and Chen, Yunpeng and Liu, Si and Tan, Zhenxiong and Yan, Shuicheng},
title = {AdversarialNAS: Adversarial Neural Architecture Search for GANs},
booktitle = {The IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2020}
}
AdversarialNAS is released under the MIT license. See LICENSE for additional details.
Some of the codes are built upon improved-gan, AutoGAN and DARTS. Thanks them for their great works!