• Stars
    star
    521
  • Rank 84,952 (Top 2 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 5 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

NASLib is a Neural Architecture Search (NAS) library for facilitating NAS research for the community by providing interfaces to several state-of-the-art NAS search spaces and optimizers.
** For the Zero-Cost NAS Competition, please switch to the automl-conf-competition branch **

  PyTorch Version   Open Source GitHub Repo Stars

       NASLib is a modular and flexible framework created with the aim of providing a common codebase to the community to facilitate research on Neural Architecture Search (NAS). It offers high-level abstractions for designing and reusing search spaces, interfaces to benchmarks and evaluation pipelines, enabling the implementation and extension of state-of-the-art NAS methods with a few lines of code. The modularized nature of NASLib allows researchers to easily innovate on individual components (e.g., define a new search space while reusing an optimizer and evaluation pipeline, or propose a new optimizer with existing search spaces). It is designed to be modular, extensible and easy to use.

NASLib was developed by the AutoML Freiburg group and with the help of the NAS community, we are constantly adding new search spaces, optimizers and benchmarks to the library. Please reach out to [email protected] for any questions or potential collaborations.

naslib-overview

Setup | Usage | Docs | Contributing | Cite

Setup

While installing the repository, creating a new conda environment is recomended. Install PyTorch GPU/CPU for your setup.

conda create -n mvenv python=3.7
conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c nvidia

Run setup.py file with the following command, which will install all the packages listed in requirements.txt

pip install --upgrade pip setuptools wheel
pip install -e .

To validate the setup, you can run tests:

cd tests
coverage run -m unittest discover -v

The test coverage can be seen with coverage report.

Queryable Benchmarks

NASLib allows you to query the following (tabular and surrogate) benchmarks for the performance of any architecture, for a given search space, dataset and task. To set them up, simply download the benchmark data files from the these URLs and place them in naslib/data.

Benchmark Task Datasets Data URL Required Files
NAS-Bench-101 Image Classification CIFAR10 cifar10 naslib/data/nasbench_only108.pkl
NAS-Bench-201 Image Classification CIFAR10
CIFAR100
ImageNet16-120
cifar10
cifar100
imagenet
naslib/data/nb201_cifar10_full_training.pickle
naslib/data/nb201_cifar100_full_training.pickle
naslib/data/nb201_ImageNet16_full_training.pickle
NAS-Bench-301 Image Classification CIFAR10 cifar10
models
naslib/data/nb301_full_training.pickle
naslib/data/nb_models/...
NAS-Bench-ASR Automatic Speech Recognition TIMIT timit naslib/data/nb-asr-bench-gtx-1080ti-fp32.pickle
naslib/data/nb-asr-bench-jetson-nano-fp32.pickle
naslib/data/nb-asr-e40-1234.pickle
naslib/data/nb-asr-e40-1235.pickle
naslib/data/nb-asr-e40-1236.pickle
naslib/data/nb-asr-info.pickle
NAS-Bench-NLP Natural Language Processing Penn Treebank ptb, models naslib/data/nb_nlp.pickle
naslib/data/nbnlp_v01/...
TransNAS-Bench-101 7 Computer Vision tasks Taskonomy taskonomy naslib/data/transnas-bench_v10141024.pth

For NAS-Bench-301 and NAS-Bench-NLP, additionally, you will have to install the NASBench301 API from here.

Once set up, you can test if the APIs work as follows:

python test_benchmark_apis.py --all --show_error

You can also test any one API.

python test_benchmark_apis.py --search_space <search_space> --show_error

Usage

To get started, check out demo.py.

search_space = SimpleCellSearchSpace()

optimizer = DARTSOptimizer(**config.search)
optimizer.adapt_search_space(search_space, config.dataset)

trainer = Trainer(optimizer, config)
trainer.search()        # Search for an architecture
trainer.evaluate()      # Evaluate the best architecture

For more examples see naslib tutorial, intro to search spaces and intro to predictors.

Scripts for running multiple experiments on a cluster

The scripts folder contains code for generating config files for running experiments across various configurations and seeds. It writes them into the naslib/configs folder.

cd scripts
bash bbo/make_configs_asr.sh

It also contains scheduler.sh files to automatically read these generated config files and submits a corresponding job to the cluster using SLURM.

Contributing

We welcome contributions to the library along with any potential issues or suggestions. Please create a pull request to the Develop branch.

Cite

If you use this code in your own work, please use the following bibtex entries:

@misc{naslib-2020, 
  title={NASLib: A Modular and Flexible Neural Architecture Search Library}, 
  author={Ruchte, Michael and Zela, Arber and Siems, Julien and Grabocka, Josif and Hutter, Frank}, 
  year={2020}, publisher={GitHub}, 
  howpublished={\url{https://github.com/automl/NASLib}} }
  
@inproceedings{mehta2022bench,
  title={NAS-Bench-Suite: NAS Evaluation is (Now) Surprisingly Easy},
  author={Mehta, Yash and White, Colin and Zela, Arber and Krishnakumar, Arjun and Zabergja, Guri and Moradian, Shakiba and Safari, Mahmoud and Yu, Kaicheng and Hutter, Frank},
  booktitle={International Conference on Learning Representations},
  year={2022}
}

predictors

NASLib has been used to run an extensive comparison of 31 performance predictors (figure above). See the separate readme: predictors.md and our paper: How Powerful are Performance Predictors in Neural Architecture Search?

@article{white2021powerful,
  title={How Powerful are Performance Predictors in Neural Architecture Search?},
  author={White, Colin and Zela, Arber and Ru, Robin and Liu, Yang and Hutter, Frank},
  journal={Advances in Neural Information Processing Systems},
  volume={34},
  year={2021}
}

More Repositories

1

auto-sklearn

Automated Machine Learning with scikit-learn
Python
7,574
star
2

Auto-PyTorch

Automatic architecture search and hyperparameter optimization for PyTorch
Python
2,358
star
3

TabPFN

Official implementation of the TabPFN paper (https://arxiv.org/abs/2207.01848) and the tabpfn package.
Python
1,187
star
4

SMAC3

SMAC3: A Versatile Bayesian Optimization Package for Hyperparameter Optimization
Python
1,067
star
5

HpBandSter

a distributed Hyperband implementation on Steroids
Python
609
star
6

RoBO

RoBO: a Robust Bayesian Optimization framework
Python
480
star
7

autoweka

Auto-WEKA
Java
330
star
8

awesome-transformer-search

A curated list of awesome resources combining Transformers with Neural Architecture Search
254
star
9

ConfigSpace

Domain specific language for configuration spaces in Python. Useful for hyperparameter optimization and algorithm configuration.
Python
202
star
10

TransformersCanDoBayesianInference

Official Implementation of "Transformers Can Do Bayesian Inference", the PFN paper
Python
183
star
11

HPOlib

HPOlib is a hyperparameter optimization library. It provides a common interface to three state of the art hyperparameter optimization packages: SMAC, spearmint and hyperopt. This package is discontinued, please read the longer note in the info box below.
Python
167
star
12

RobustDARTS

Understanding and Robustifying DARTS
Python
153
star
13

trivialaugment

This is the official implementation of TrivialAugment and a mini-library for the application of multiple image augmentation strategies including RandAugment and TrivialAugment.
Python
147
star
14

HPOBench

Collection of hyperparameter optimization benchmark problems
Python
137
star
15

pybnn

Bayesian neural network package
Jupyter Notebook
135
star
16

CARL

Benchmarking RL generalization in an interpretable way.
Python
129
star
17

CAAFE

Semi-automatic feature engineering process using Language Models and your dataset descriptions. Based on the paper "LLMs for Semi-Automated Data Science: Introducing CAAFE for Context-Aware Automated Feature Engineering" by Hollmann, Müller, and Hutter (2023).
Python
124
star
18

nas_benchmarks

Python
91
star
19

ParameterImportance

Parameter Importance Analysis Tool
Python
75
star
20

nasbench301

Python
74
star
21

DEHB

Python
71
star
22

DeepCAVE

An interactive framework to visualize and analyze your AutoML process in real-time.
Python
70
star
23

HPOlib1.5

Python
69
star
24

nasbench-1shot1

Python
67
star
25

BOAH

BOAH: Bayesian Optimization & Analysis of Hyperparameters
Python
67
star
26

amltk

A build-it-yourself AutoML Framework
Python
62
star
27

labwatch

An extension to Sacred for automated hyperparameter optimization.
Python
59
star
28

learna

End-to-end RNA Design using deep reinforcement learning
Python
57
star
29

neps

Neural Pipeline Search (NePS): Helps deep learning experts find the best neural pipeline.
Python
54
star
30

CAVE

[deprecated] Configuration Assessment, Visualization and Evaluation
Python
46
star
31

PFNs

Our maintained PFN repository. Come here to train SOTA PFNs.
Python
44
star
32

zero-shot-automl-with-pretrained-models

Official repository for the paper "Zero-Shot AutoML with Pretrained Models"
Python
41
star
33

random_forest_run

C++
35
star
34

AutoFolio

Automated Algorithm Selection with Hyperparameter Optimization
Python
35
star
35

SEARL

Sample-Efficient Automated Deep Reinforcement Learning
Python
34
star
36

nes

Neural Ensemble Search for Uncertainty Estimation and Dataset Shift
Python
31
star
37

LCBench

A learning curve benchmark on OpenML data
Jupyter Notebook
29
star
38

DACBench

A benchmark library for Dynamic Algorithm Configuration.
PDDL
28
star
39

mdp-playground

A python package to design and debug RL agents.
Python
28
star
40

RNAformer

Scalable Deep Learning for RNA Secondary Structure Prediction
Python
27
star
41

auto-sklearn-talks

Presentations on Auto-sklearn
Jupyter Notebook
24
star
42

multi-obj-baselines

Python
22
star
43

PFNs4BO

The official implementation of PFNs4BO: In-Context Learning for Bayesian Optimization
Jupyter Notebook
22
star
44

CVPR24-MedSAM-on-Laptop

Data-aware Fine-Tuning (DAFT) Code related to the CPVR24 Competition for Image Segmentation on a Laptop.
Python
22
star
45

tabpfn-client

Python
21
star
46

learning_environments

Python
20
star
47

pynisher

Python
20
star
48

DE-NAS

Jupyter Notebook
19
star
49

DAC

Dynamic Algorithm Configuration
Jupyter Notebook
19
star
50

nas-bench-x11

Python
18
star
51

ProbTransformer

Probabilistic Transformer: Modelling Ambiguities and Distributions for RNA Folding and Molecule Design
Python
17
star
52

Mighty

The Mighty cRL library you've been looking for! 💪
Python
17
star
53

TempoRL

Python
15
star
54

HPO_for_RL

This is the code of reproducing the results of our paper: On the importance of Hyperparameter Optimization for Model-based Reinforcement Learning
Python
15
star
55

hierarchical_nas_construction

Official repository for "Construction of Hierarchical Neural Architecture Search Spaces based on Context-free Grammars" (NeurIPS 2023)
Python
14
star
56

transfer-hpo-framework

Code accompanying https://arxiv.org/abs/1802.02219
Python
14
star
57

jahs_bench_201

The first collection of surrogate benchmarks for Joint Architecture and Hyperparameter Search.
Python
14
star
58

Squirrel-Optimizer-BBO-NeurIPS20-automlorg

Python
13
star
59

SVGe

Smooth Variational Graph Embeddings for Efficient Neural Architecture Search
Python
13
star
60

is_mamba_capable_of_icl

Jupyter Notebook
12
star
61

ChaLearn_Automatic_Machine_Learning_Challenge_2015

Python
11
star
62

GenericWrapper4AC

C++
11
star
63

HW-GPT-Bench

HW-GPT-Bench: Hardware-Aware Architecture Benchmark for Language Models
Python
11
star
64

QTT

A framework for QuickTune
Jupyter Notebook
11
star
65

ifBO

In-context Bayesian Optimization
Python
11
star
66

arlbench

HPO and Architecture Benchmarking for RL: Dynamically, Reactive and Efficient
Python
10
star
67

lcpfn

Jupyter Notebook
10
star
68

ASKL2.0_experiments

Jupyter Notebook
9
star
69

mf-prior-bench

A collection of multi-fidelity benchmarks with first class support for user priors
Python
8
star
70

LTO-CMA

Code for the paper "Learning Step-Size Adaptation in CMA-ES"
Python
8
star
71

EfficientNAS

Python
8
star
72

HPOlibConfigSpace

Python
8
star
73

paramsklearn

Python
8
star
74

multibeep

A Multi Armed Bandit library written in C++ with Python bindings
C
8
star
75

MODNAS

Official Repo for "Multi-objective Differentiable Neural Architecture Search"
Python
8
star
76

TabularTempoRL

Code for the paper "Towards TempoRL: Learning When to Act"
Python
8
star
77

CARP-S

A Framework for Comparing N Hyperparameter Optimizers on M Benchmarks.
Jupyter Notebook
8
star
78

HPOBenchExperimentUtils

Experiment code to run large-scale experimente with HPOBench
Python
7
star
79

hypersweeper

Hydra sweeper integration of our favorite optimization packages, utilizing ask-and-tell interfaces.
Python
6
star
80

HPOlib-hpconvnet

A wrapper for James Bergstras hyperopt convnet
Python
5
star
81

SPaCE

Jupyter Notebook
5
star
82

dac4automlcomp

DAC4AutoML Competition
HTML
5
star
83

IMFAS

Implicit Multi-Fidelity Algorithm Selection
Python
5
star
84

automl_common

This repository holds shared utilities that AutoML frameworks may benefit from.
Python
5
star
85

ParameterConfigSpace

parameter configuration space parser for SMAC format
Python
5
star
86

masif

MASIF: Meta-learned Algorithm Selection using Implicit Fidelity Information
Python
5
star
87

DAC4SGD

Python
5
star
88

automl_template

A template that provides all the tools to ensure the same project setup across all AutoML packages.
Python
5
star
89

AutoRL-Landscape

Python
4
star
90

SAWEI

Jupyter Notebook
4
star
91

hydra-smac-sweeper

Sweeper plugin based on SMAC for Hydra.
Python
4
star
92

DAC4RL

DAC4RL track of DAC4AutoML competition at AutoML Conf
Python
4
star
93

pi_is_back

Repo for "PI is back! Switching Acquisition Functions in Bayesian Optimization" (NeurIPS: Gaussian Process Workshop '22)
Python
4
star
94

BO-AFS

For BO: Select Acquisition Function (Schedule) with Meta-Learned Model Per-Run
Jupyter Notebook
4
star
95

HPOlib-AutoWEKA

Python
3
star
96

AutoDLComp19

AutoDL Competition Scripts 2019
Python
3
star
97

mf-prior-exp

Python
3
star
98

ICGen

Image Classification Dataset Generator
Python
3
star
99

AutomlCup2023

Code for the AutoMLCup 2023
Python
3
star
100

FOB

Python
3
star