Awesome
AdversarialNAS-GAN
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.
Introduction
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.
<img src="imgs/fig-cell.png" alt="nas-gan" width="400" height="206">Architecture search snapshots
<img src="imgs/snapshot_examples/G.gif" alt="G"> <img src="imgs/snapshot_examples/D.gif" alt="D">Checklist
- 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.
Getting Started
Installation
-
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
Preparing necessary files
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
Search
New features
- Better performance
- Supporting Amended Gradient Estimation
Train and Test the searched architecture.
Training
-
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
Testing
-
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
Citation
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}
}
License
AdversarialNAS is released under the MIT license. See LICENSE for additional details.
Acknowledge
Some of the codes are built upon improved-gan, AutoGAN and DARTS. Thanks them for their great works!