Git Product home page Git Product logo

cap's Introduction

CAP: A Context-Aware Neural Predictor for NAS (IJCAI24)

The implementation for CAP: A Context-Aware Neural Predictor for NAS (IJCAI24)

The overview of CAP.

Requirements

python == 3.8
tensorflow == 2.2.0
torch == 2.0.1
torchvision == 0.15.2
torch-geometric == 2.3.1

Data Preparation

Two datasets are required: NAS-Bench-101 and NAS-Bench-201. You can download these two datasets from the following links and put them under the folder datasets.

NAS-Bench-101:

project links:https://github.com/google-research/nasbench

dataset links:https://storage.googleapis.com/nasbench/nasbench_full.tfrecord

NAS-Bench-201:

project links:https://github.com/D-X-Y/NAS-Bench-201

dataset links:https://drive.google.com/file/d/16Y0UwGisiouVRxW-W5hEtbxmcHw_0hF_/view

How to Use

NAS-Bench-101

  • We get the compressed NAS-Bench-101 file nasbench.hdf5 using the script: tfrecord_2_hdf5.py
  • Once you get nasbench.hdf5, you can randomly generate the training samples using the script: make_splits.py

To pretrain CAP on NAS-Bench-101, you can run:

python pretrain_model.py --bench 101 --split 381262 

Then, you can get Pretrain_101.pth under the folder wts.
To train CAP using NAS-Bench-101, you can run:

python train_model.py --bench 101 --train_split 100 --test_split all --loss bpr --is_pretrained True --pretrained_model wts/Pretrain_101.pth

To search for promising architectures on NAS-Bench-101, you can run:

python search_101.py --N 150 

NAS-Bench-201

  • nasbench201_dict.npy is generated using the script: pth_2_npy.py
    To pretrain CAP on NAS-Bench-201, you can run:
python pretrain_model.py --bench 201 --split 14063 

Then, you can get Pretrain_201.pth under the folder wts.
To train CAP using NAS-Bench-201, you can run:

python train_model.py --bench 201 --dataset cifar10 --train_split 78 --test_split all --loss bpr --is_pretrained True --pretrained_model wts/Pretrain_201.pth

To search for promising architectures on NAS-Bench-201, you can run search_201.py:

python search_201.py --dataset cifar10 --N 150 

cap's People

Contributors

jihan4431 avatar

Stargazers

 avatar

Watchers

 avatar

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.