Need help with bananas?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.


Bayesian Optimization with Neural Architectures for Neural Architecture Search -

3 Stars 0 Forks Apache License 2.0 3 Commits 0 Opened issues

Services available

Need anything else?


Note: our naszilla/bananas repo has been extended and renamed to naszilla/naszilla, and this repo is deprecated and not maintained. Please use naszilla/naszilla, which has more functionality.

BANANAS: Bayesian Optimization with Neural Architectures for Neural Architecture Search\ Colin White, Willie Neiswanger, and Yash Savani.\ arXiv:1910.11858.

A new method for neural architecture search

BANANAS is a neural architecture search (NAS) algorithm which uses Bayesian optimization with a meta neural network to predict the validation accuracy of neural architectures. We use a path-based encoding scheme to featurize the neural architectures that are used to train the neural network model. After training on just 200 architectures, we are able to predict the validation accuracy of new architectures to within one percent on average. The full NAS algorithm beats the state of the art on the NASBench and the DARTS search spaces. On the NASBench search space, BANANAS is over 100x more efficient than random search, and 3.8x more efficent than the next-best algorithm we tried. On the DARTS search space, BANANAS finds an architecture with a test error of 2.57%.



  • 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)

If you run experiments on DARTS, you will need our fork of the darts repo: - Download the repo: - If the repo is not in your home directory, i.e.,

, then update line 5 of
and line 8 of
with the correct path to this repo

Train a meta neural network with a notebook on the NASBench dataset

  • Download the nasbench_only108 tfrecord file (size 499MB) here
  • Place
    in the top level folder of this repo
  • Open and run
    to reproduce Table 1 and Figure A.1 of our paper

bananas_fig bananas_fig bananas_fig bananas_fig

Evaluate pretrained BANANAS architecture

The best architecture found by BANANAS on the DARTS search space achieved 2.57% test error. To evaluate our pretrained neural architecture, download the weights and put it inside the folder

cd /cnn; python --model_path

The error on the test set should be 2.57%. This can be run on a CPU or GPU, but it will be faster on a GPU.

bananas_normal bananas_reduction

The best neural architecture found by BANANAS on CIFAR-10. Convolutional cell (left), and reduction cell (right).

Train BANANAS architecture

Train the best architecture found by BANANAS.

cd /cnn; python --auxiliary --cutout

This will train the architecture from scratch, which takes about 34 hours on an NVIDIA V100 GPU. The final test error should be 2.59%. Setting the random seed to 4 by adding

--seed 4
will result in a test error of 2.57%. We report the random seeds and hardware used in Table 2 of our paper here.

Run BANANAS on the NASBench search space

To run BANANAS on NASBench, download

and place it in the top level folder of this repo.

This will test the nasbench algorithm against several other NAS algorithms on the NASBench search space. To customize your experiment, open
. Here, you can change the hyperparameters and the algorithms to run. To run experiments with NAS-Bench-201, download
and place it in the top level folder of this repo. Choose between cifar10, cifar100, and imagenet. For example,
python --search_space nasbench_201_cifar10


Run BANANAS on the DARTS search space

We highly recommend using multiple GPUs to run BANANAS on the DARTS search space. You can run BANANAS in parallel on GCP using the shell script:


We welcome community contributions to this repo!


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

  title={BANANAS: Bayesian Optimization with Neural Architectures for Neural Architecture Search},
  author={White, Colin and Neiswanger, Willie and Savani, Yash},
  journal={arXiv preprint arXiv:1910.11858},

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.