Skip to content

TedSYt/nas-encodings

 
 

Repository files navigation

A Study on Encodings for Neural Architecture Search

A Study on Encodings for Neural Architecture Search
Colin White, Willie Neiswanger, Sam Nolen, and Yash Savani.
arxiv:2007.04965.

Many algorithms for neural architecture search (NAS) represent each neural architecture in the search space as a directed acyclic graph (DAG), and then search over all DAGs by encoding the adjacency matrix and list of operations as a set of hyperparameters. Recent work has demonstrated that even small changes to the way each architecture is encoded can have a significant effect on the performance of NAS algorithms. We present the first formal study on the effect of architecture encodings for NAS.

Requirements

  • jupyter
  • tensorflow == 1.14.0 (used for all experiments)
  • nasbench (follow the installation instructions here)
  • nas-bench-201 (follow the installation instructions here)
  • pytorch == 1.2.0, torchvision == 0.4.0 (used for experiments on the DARTS search space)
  • pybnn (used only for the DNGO baselien algorithm. Installation instructions here)

Download nasbench-101

  • Download the nasbench_only108 tfrecord file (size 499MB) here
  • Place nasbench_only108.tfrecord in the top level folder of this repo

Download index-hash

Some of the path-based encoding methods require a hash map from path indices to cell architectures. We have created a pickle file which contains this hash map (size 57MB), located here. Place it in the top level folder of this repo.

Get started quickly: open jupyter notebook

  • The easiest way to get started is to run one of our jupyter notebooks
  • Open and run meta_neuralnet.ipynb to train a neural predictor with different encodings
  • Open and run notebooks/test_nas.ipynb to test out each algorithm + encoding combination

Run experiments on nasbench-101

python run_experiments_sequential.py --algo_params evo_encodings

This command will run evolutionary search with six different encodings. To run other experiments, open up params.py.

Run experiments on nasbench-201

To run experiments with NAS-Bench-201, download NAS-Bench-201-v1_0-e61699.pth from here and place it in the top level folder of this repo. Choose between cifar10, cifar100, and imagenet. For example,

python run_experiments_sequential.py --algo_params evo_encodings --search_space nasbench_201_cifar10

Citation

Please cite our paper if you use code from this repo:

@article{white2020study,
  title={A Study on Encodings for Neural Architecture Search},
  author={White, Colin and Neiswanger, Willie and Nolen, Sam and Savani, Yash},
  journal={arXiv preprint arXiv:2007.04965},
  year={2020}
}

About

Encodings for neural architecture search

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 93.7%
  • Jupyter Notebook 4.7%
  • Shell 1.6%