NAS-Bench-x11 and the Power of Learning Curves

Overview

NAS-Bench-x11

NAS-Bench-x11 and the Power of Learning Curves
Shen Yan, Colin White, Yash Savani, Frank Hutter.
NeurIPS 2021.

Surrogate NAS benchmarks for multi-fidelity algorithms

We present a method to create surrogate neural architecture search (NAS) benchmarks, NAS-Bench-111, NAS-Bench-311, and NAS-Bench-NLP11, that output the full training information for each architecture, rather than just the final validation accuracy. This makes it possible to benchmark multi-fidelity techniques such as successive halving and learning curve extrapolation (LCE). Then we present a framework for converting popular single-fidelity algorithms into LCE-based algorithms.

nas-bench-x11

Installation

Clone this repository and install its requirements.

git clone https://github.com/automl/nas-bench-x11
cd nas-bench-x11
cat requirements.txt | xargs -n 1 -L 1 pip install
pip install -e .

Download the pretrained surrogate models and place them into checkpoints/. The current models are v0.5. We will continue to improve the surrogate model by adding the sliding window noise model.

NAS-Bench-311 and NAS-Bench-NLP11 will work as is. To use NAS-Bench-111, first install NAS-Bench-101.

Using the API

The api is located in nas_bench_x11/api.py.

Here is an example of how to use the API:

from nas_bench_x11.api import load_ensemble

# load the surrogate
nb311_surrogate_model = load_ensemble('path/to/nb311-v0.5')

# define a genotype as in the original DARTS repository
from collections import namedtuple
Genotype = namedtuple('Genotype', 'normal normal_concat reduce reduce_concat')
arch = Genotype(normal=[('sep_conv_3x3', 0), ('sep_conv_5x5', 1), ('skip_connect', 1), ('max_pool_3x3', 2), ('sep_conv_3x3', 0), ('dil_conv_5x5', 1), ('sep_conv_5x5', 2), ('dil_conv_5x5', 4)], \
                normal_concat=[2, 3, 4, 5, 6], \
                reduce=[('dil_conv_5x5', 0), ('skip_connect', 1), ('avg_pool_3x3', 0), ('sep_conv_5x5', 1), ('avg_pool_3x3', 0), ('max_pool_3x3', 2), ('sep_conv_3x3', 1), ('max_pool_3x3', 3)], \
                reduce_concat=[4, 5, 6])

# query the surrogate to output the learning curve
learning_curve = nb311_surrogate_model.predict(config=arch, representation="genotype", with_noise=True)
print(learning_curve)
# outputs: [34.50166741 44.77032749 50.62796474 ... 93.47724664]

Run NAS experiments from our paper

You will also need to download the nas-bench-301 runtime model lgb_runtime_v1.0 and place it inside a folder called nb_models.

# Supported optimizers: (rs re ls bananas)-{svr, lce}, hb, bohb 

bash naslib/benchmarks/nas/run_nb311.sh 
bash naslib/benchmarks/nas/run_nb201.sh 
bash naslib/benchmarks/nas/run_nb201_cifar100.sh 
bash naslib/benchmarks/nas/run_nb201_imagenet16-200.sh
bash naslib/benchmarks/nas/run_nb111.sh 
bash naslib/benchmarks/nas/run_nbnlp.sh 

Results will be saved in results/.

Citation

@inproceedings{yan2021bench,
  title={NAS-Bench-x11 and the Power of Learning Curves},
  author={Yan, Shen and White, Colin and Savani, Yash and Hutter, Frank},
  booktitle={Thirty-Fifth Conference on Neural Information Processing Systems},
  year={2021}
}
You might also like...
Implementation of "A Deep Learning Loss Function based on Auditory Power Compression for Speech Enhancement" by pytorch

This repository is used to suspend the results of our paper "A Deep Learning Loss Function based on Auditory Power Compression for Speech Enhancement"

A little Python application to auto tag your photos with the power of machine learning.
A little Python application to auto tag your photos with the power of machine learning.

Tag Machine A little Python application to auto tag your photos with the power of machine learning. Report a bug or request a feature Table of Content

 Multi-Agent Reinforcement Learning for Active Voltage Control on Power Distribution Networks (MAPDN)
Multi-Agent Reinforcement Learning for Active Voltage Control on Power Distribution Networks (MAPDN)

Multi-Agent Reinforcement Learning for Active Voltage Control on Power Distribution Networks (MAPDN) This is the implementation of the paper Multi-Age

Calculates carbon footprint based on fuel mix and discharge profile at the utility selected. Can create graphs and tabular output for fuel mix based on input file of series of power drawn over a period of time.

carbon-footprint-calculator Conda distribution ~/anaconda3/bin/conda install anaconda-client conda-build ~/anaconda3/bin/conda config --set anaconda_u

Easy and comprehensive assessment of predictive power, with support for neuroimaging features
Easy and comprehensive assessment of predictive power, with support for neuroimaging features

Documentation: https://raamana.github.io/neuropredict/ News As of v0.6, neuropredict now supports regression applications i.e. predicting continuous t

Expressive Power of Invariant and Equivaraint Graph Neural Networks (ICLR 2021)
Expressive Power of Invariant and Equivaraint Graph Neural Networks (ICLR 2021)

Expressive Power of Invariant and Equivaraint Graph Neural Networks In this repository, we show how to use powerful GNN (2-FGNN) to solve a graph alig

Based on Yolo's low-power, ultra-lightweight universal target detection algorithm, the parameter is only 250k, and the speed of the smart phone mobile terminal can reach ~300fps+
Based on Yolo's low-power, ultra-lightweight universal target detection algorithm, the parameter is only 250k, and the speed of the smart phone mobile terminal can reach ~300fps+

Based on Yolo's low-power, ultra-lightweight universal target detection algorithm, the parameter is only 250k, and the speed of the smart phone mobile terminal can reach ~300fps+

nfelo: a power ranking, prediction, and betting model for the NFL

nfelo nfelo is a power ranking, prediction, and betting model for the NFL. Nfelo take's 538's Elo framework and further adapts it for the NFL, hence t

Draw like Bob Ross using the power of Neural Networks (With PyTorch)!
Draw like Bob Ross using the power of Neural Networks (With PyTorch)!

Draw like Bob Ross using the power of Neural Networks! (+ Pytorch) Learning Process Visualization Getting started Install dependecies Requires python3

Comments
  • no setup.py

    no setup.py

    python3 -m pip install -e . ERROR: File "setup.py" or "setup.cfg" not found. Directory cannot be installed in editable mode: /xxx/Documents/nas-bench-x11

    opened by yaoyang33 1
  • Help for predicting the learning curve of training losses

    Help for predicting the learning curve of training losses

    Hi guys, I'm practicing on the example code and I found that the API only supported for predicting the validation accuracy, but in your paper, I see that the API can predict for the losses. Can you make an example for using API to predict the train/validation losses. Thank you guys for a great paper.

    opened by f4nku4n 0
  • Surrogate_model.model from nb211-v0.5 is not able to be loaded

    Surrogate_model.model from nb211-v0.5 is not able to be loaded

    Hi, I downgraded TF to the version you specified and have nasbench installed. nb311-v0.5 surrogate model is able to be loaded, but not nb111 and nb211.

    When I load nb211, I run into keyError Traceback (most recent call last): File "example.py", line 5, in nb311_surrogate_model = load_ensemble('/Users/yao.a.yang/Documents/nas-bench-x11/checkpoints/nb211-v0.5') File "/Users/yao.a.yang/Documents/nas-bench-x11/nas_bench_x11/api.py", line 68, in load_ensemble surrogate_model.load(model_paths=ensemble_member_dirs) File "/Users/yao.a.yang/Documents/nas-bench-x11/nas_bench_x11/ensemble.py", line 142, in load ens_mem.load(os.path.join(member_logdir, 'surrogate_model.model')) File "/Users/yao.a.yang/Documents/nas-bench-x11/nas_bench_x11/models/svd_lgb.py", line 118, in load if len(joblib.load(model_path)) == 5: File "/usr/local/anaconda3/envs/py36/lib/python3.6/site-packages/joblib/numpy_pickle.py", line 587, in load obj = _unpickle(fobj, filename, mmap_mode) File "/usr/local/anaconda3/envs/py36/lib/python3.6/site-packages/joblib/numpy_pickle.py", line 506, in _unpickle obj = unpickler.load() File "/usr/local/anaconda3/envs/py36/lib/python3.6/pickle.py", line 1050, in load dispatchkey[0] KeyError: 239

    For surrogate_model.model in nb111-v0.5, see error: /usr/local/anaconda3/envs/py36/lib/python3.6/site-packages/sklearn/base.py:315: UserWarning: Trying to unpickle estimator RegressorChain from version 0.23.2 when using version 0.24.2. This might lead to breaking code or invalid results. Use at your own risk. UserWarning) /usr/local/anaconda3/envs/py36/lib/python3.6/site-packages/sklearn/base.py:315: UserWarning: Trying to unpickle estimator StandardScaler from version 0.23.2 when using version 0.24.2. This might lead to breaking code or invalid results. Use at your own risk. UserWarning) <nas_bench_x11.models.svd_lgb.SVDLGBModel object at 0x7fa5ac487f28> [<nas_bench_x11.models.svd_lgb.SVDLGBModel object at 0x7fa5ac487f28>] Traceback (most recent call last): File "example.py", line 17, in learning_curve = nb311_surrogate_model.predict(config=arch, representation="genotype", with_noise=True) File "/Users/yao.a.yang/Documents/nas-bench-x11/nas_bench_x11/api.py", line 113, in predict pred = self.model.query(config_dict, search_space=search_space) File "/Users/yao.a.yang/Documents/nas-bench-x11/nas_bench_x11/ensemble.py", line 290, in query use_noise=True) File "/Users/yao.a.yang/Documents/nas-bench-x11/nas_bench_x11/models/svd_lgb.py", line 161, in query comp = self.model.predict(X)
    File "/usr/local/anaconda3/envs/py36/lib/python3.6/site-packages/sklearn/multioutput.py", line 549, in predict Y_pred_chain[:, chain_idx] = estimator.predict(X_aug) File "/usr/local/anaconda3/envs/py36/lib/python3.6/site-packages/lightgbm/sklearn.py", line 800, in predict raise ValueError("Number of features of the model must " ValueError: Number of features of the model must match the input. Model n_features_ is 30 and input n_features is 56

    Any guidance? Thanks!

    opened by yaoyang33 1
Owner
AutoML-Freiburg-Hannover
AutoML-Freiburg-Hannover
[ICLR 2021] HW-NAS-Bench: Hardware-Aware Neural Architecture Search Benchmark

HW-NAS-Bench: Hardware-Aware Neural Architecture Search Benchmark Accepted as a spotlight paper at ICLR 2021. Table of content File structure Prerequi

null 72 Jan 3, 2023
Tgbox-bench - Simple TGBOX upload speed benchmark

TGBOX Benchmark This script will benchmark upload speed to TGBOX storage. Build

Non 1 Jan 9, 2022
MNIST, but with Bezier curves instead of pixels

bezier-mnist This is a work-in-progress vector version of the MNIST dataset. Samples Here are some samples from the training set. Note that, while the

Alex Nichol 15 Jan 16, 2022
Code for the KDD 2021 paper 'Filtration Curves for Graph Representation'

Filtration Curves for Graph Representation This repository provides the code from the KDD'21 paper Filtration Curves for Graph Representation. Depende

Machine Learning and Computational Biology Lab 16 Oct 16, 2022
Plotting points that lie on the intersection of the given curves using gradient descent.

Plotting intersection of curves using gradient descent Webapp Link ---> What's the app about Why this app Plotting functions and their intersection. A

Divakar Verma 2 Jan 9, 2022
[CVPR 2021] 'Searching by Generating: Flexible and Efficient One-Shot NAS with Architecture Generator'

[CVPR2021] Searching by Generating: Flexible and Efficient One-Shot NAS with Architecture Generator Overview This is the entire codebase for the paper

null 35 Dec 1, 2022
[ICLR2021oral] Rethinking Architecture Selection in Differentiable NAS

DARTS-PT Code accompanying the paper ICLR'2021: Rethinking Architecture Selection in Differentiable NAS Ruochen Wang, Minhao Cheng, Xiangning Chen, Xi

Ruochen Wang 86 Dec 27, 2022
NAS Benchmark in "Prioritized Architecture Sampling with Monto-Carlo Tree Search", CVPR2021

NAS-Bench-Macro This repository includes the benchmark and code for NAS-Bench-Macro in paper "Prioritized Architecture Sampling with Monto-Carlo Tree

null 35 Jan 3, 2023
CM-NAS: Cross-Modality Neural Architecture Search for Visible-Infrared Person Re-Identification (ICCV2021)

CM-NAS Official Pytorch code of paper CM-NAS: Cross-Modality Neural Architecture Search for Visible-Infrared Person Re-Identification in ICCV2021. Vis

JDAI-CV 40 Nov 25, 2022
Naszilla is a Python library for neural architecture search (NAS)

A repository to compare many popular NAS algorithms seamlessly across three popular benchmarks (NASBench 101, 201, and 301). You can implement your ow

null 270 Jan 3, 2023