Home

Awesome

XNAS: Neural Architecture Search with Expert Advice

Code accompanying the paper

XNAS: Neural Architecture Searchwith Expert Advice
Niv Nayman, Asaf Noy, Tal Ridnik, Itamar Friedman, Rong Jin, Lihi Zelnik-Manor.
arXiv:1906.08031.

The algorithm is based on Prediction with Expert Advice theory (PEA) combined with continuous relaxation and gradient descent in the architecture space introduced in DARTS. It is able to efficiently design high-performance convolutional architectures for image classification (on CIFAR-10, ImageNet and more).

<p align="center"> <img src="images/problem_statement.png" alt="problem_statement" width="90%"> <img src="images/xnas_algo.png" alt="xnas_algo" width="90%"> </p>

Requirements

Python >= 3.5.5, PyTorch >= 1.1.0, torchvision >= 0.2.0, CUDA >= 10.0, cuDNN >= 7.5, thop

Datasets

CIFAR-10 can be automatically downloaded by torchvision. ImageNet needs to be manually downloaded following the instructions here.

Reproducing the results

We hereby provide the trained models accompanied with the code necessary for reproducing the results reported in the paper.

<p align="center"> <img src="images/xnas_cells.png" alt="xnas_cells" width="30%"> <img src="images/xnas_results.png" alt="xnas_results" width="59%"> </p>

CIFAR-10 | XNAS-Small

python test.py [--calc_flops] --init_channels=36 --model_path="trained_models/xnas_small_cifar10.t7"

CIFAR-10 | XNAS-Medium

python test.py [--calc_flops] --init_channels=44 --model_path="trained_models/xnas_medium_cifar10.t7"

CIFAR-10 | XNAS-Large

python test.py [--calc_flops] --init_channels=50 --model_path="trained_models/xnas_large_cifar10.t7"

ImageNet

python test_imagenet.py [--calc_flops] --model_path="trained_models/imagenet.pth.tar"

CIFAR-10 | XNAS-Plain

i.e. XNAS cells trained in the same settings as of DARTS for another comparison.

python test.py [--calc_flops] --model_path="trained_models/xnas_plain.t7"

Citation

If you use any part of this code in your research, please cite our paper:

@article{nayman2019xnas,
  title={XNAS: Neural Architecture Search with Expert Advice},
  author={Nayman, Niv and Noy, Asaf and Ridnik, Tal and Friedman, Itamar and Jin, Rong and Zelnik-Manor, Lihi},
  journal={arXiv preprint arXiv:1906.08031},
  year={2019}
}

and DARTS for providing the initial code.