Skip to content

[CVPR 2020] Code for paper "AdversarialNAS: Adversarial Neural Architecture Search for GANs".

License

Notifications You must be signed in to change notification settings

wxbbuaa2011/AdversarialNAS

 
 

Repository files navigation

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.

nas-gan

Architecture search snapshots

G

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

  1. Clone this repository.

    git clone https://github.com/chengaopro/AdversarialNAS.git
    
  2. 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
    
  3. Install the requirements via pip.

    pip install -r requirements.txt
    

Preparing necessary files

  1. Download the two trained generative models (Baidu drive, passcode: uplb) 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 
    
  2. Download the pre-calculated statistics (Baidu drive, passcode: uplb) to ./fid_stat for calculating the FID.

    mkdir fid_stat
    
  3. Download the inception model (Baidu drive, passcode: uplb) to ./tmp for calculating the IS and FID.

    mkdir tmp
    

Search

Coming soon.

Train and Test the searched architecture.

Training

  1. 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

  1. 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!

About

[CVPR 2020] Code for paper "AdversarialNAS: Adversarial Neural Architecture Search for GANs".

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.9%
  • Shell 2.1%