Giter Site home page Giter Site logo

einspace's Introduction

einspace: Searching for Neural Architectures from Fundamental Operations

[paper] [project page]

This is the official codebase for einspace, a new expressive search space for neural architecture search.

image

Diverse architectures can be represented in our expressive space as shown above for ConvNets, transformers and MLP-only networks.

Follow the instructions below to set up the environment, data, and then run an example script.

Environment Setup

We provide a sample setting up script as following:

conda create -n einspace python=3.10 -y
source activate einspace
pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 -f https://download.pytorch.org/whl/torch_stable.html
pip install git+https://github.com/SamsungLabs/zero-cost-nas.git
pip install tqdm scipy einops positional_encodings seaborn sympy h5py librosa
pip install -r requirements.txt
pip install -e .

Data Setup

Please follow the official instructions of UnseenNAS and NASBench360 to setup the dataset, after which you can place the files using the following arrangement.

einspace
|--data
|   |--adinst
|   |  |__metadata, test_x.npy, test_y.npy ...
|   |--language
|   |  |__metadata, test_x.npy, test_y.npy ...
|   |--multnist
|   |  |__metadata, test_x.npy, test_y.npy ...
|   |--cifartile
|   |  |__metadata, test_x.npy, test_y.npy ...
|   |--gutenberg
|   |  |__metadata, test_x.npy, test_y.npy ...
|   |--isabella
|   |  |__metadata, test_x.npy, test_y.npy ...
|   |--geoclassing
|   |  |__metadata, test_x.npy, test_y.npy ...
|   |--chesseract
|   |  |__metadata, test_x.npy, test_y.npy ...
|   |--cifar100
|   |   |--cifar100_train.indices
|   |   |--cifar100_valid.indices
|   |   |__cifar-100-python
|   |      |--meta
|   |      |--train
|   |      |__test
|   |--NinaPro
|   |   |__label_test.npy, label_train.npy, label_val.npy, ninapro_test.npy, ninapro_train.npy, ninapro_val.npy
|   |--Spherical
|   |   |__s2_cifar100.gz, spherical_train.indices, spherical_valid.indices
|   |--darcyflow
|   |   |__piececonst_r421_N1024_smooth1.mat, piececonst_r421_N1024_smooth2.mat
|   |--cosmic
|      |--cosmic_test.pt
|      |--cosmic_train.pt
|      |--cosmic_valid.pt
|      |--npy_test  
|      |--npy_train  
|      |--test_dirs.npy  
|      |__train_dirs.npy
|_ ...

Running Experiments

python einspace/main.py --config $config --device $GPU

For example, to execute the RE(RN18) experiment on the Language dataset, you can run

python einspace/main.py --config configs/language/re_language.yaml --device cuda:0

Cite us!

@article{ericsson2024einspace,
    title={einspace: Searching for Neural Architectures from Fundamental Operations}, 
    author={Linus Ericsson and Miguel Espinosa and Chenhongyi Yang and Antreas Antoniou and Amos Storkey and Shay B. Cohen and Steven McDonagh and Elliot J. Crowley},
    year={2024},
    eprint={2405.20838},
    archivePrefix={arXiv},
    primaryClass={cs.LG}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.