Skip to main content

No project description provided

Project description

NASBench-PyTorch

NASBench-PyTorch is a PyTorch implementation of the search space NAS-Bench-101 including the training of the networks**. The original implementation is written in TensorFlow, and this projects contains some files from the original repository (in the directory nasbench_pytorch/model/).

Overview

A PyTorch implementation of training of NAS-Bench-101 dataset: NAS-Bench-101: Towards Reproducible Neural Architecture Search. The dataset contains 423,624 unique neural networks exhaustively generated and evaluated from a fixed graph-based search space.

Usage

You need to have PyTorch installed.

You can install the package by running pip install nasbench_pytorch. The second possibility is to install from source code:

  1. Clone this repo
git clone https://github.com/romulus0914/NASBench-PyTorch
cd NASBench-PyTorch
  1. Install the project
pip install -e .

The file main.py contains an example training of a network. To see the different parameters, run:

python main.py --help

Train a network by hash

To train a network whose architecture is queried from NAS-Bench-101 using its unique hash, install the original nasbench repository. Follow the instructions in the README, note that you need to install TensorFlow. If you need TensorFlow 2.x, install this fork of the repository instead.

Then, you can get the PyTorch architecture of a network like this:

from nasbench_pytorch.model import Network as NBNetwork
from nasbench import api


nasbench_path = '$path_to_downloaded_nasbench'
nb = api.NASBench(nasbench_path)

net_hash = '$some_hash'  # you can get hashes using nasbench.hash_iterator()
m = nb.get_metrics_from_hash(net_hash)
ops = m[0]['module_operations']
adjacency = m[0]['module_adjacency']

net = NBNetwork((adjacency, ops))

Then, you can train it just like the example network in main.py.

Architecture

Example architecture (picture from the original repository) archtecture

Disclaimer

Modified from NASBench: A Neural Architecture Search Dataset and Benchmark. graph_util.py and model_spec.py are directly copied from the original repo. Original license can be found here.

**Please note that this repo is only used to train one possible architecture in the search space, not to generate all possible graphs and train them.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nasbench_pytorch-1.2.tar.gz (188.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nasbench_pytorch-1.2-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file nasbench_pytorch-1.2.tar.gz.

File metadata

  • Download URL: nasbench_pytorch-1.2.tar.gz
  • Upload date:
  • Size: 188.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for nasbench_pytorch-1.2.tar.gz
Algorithm Hash digest
SHA256 7bf4e97a9b4e45ae976694e51156ccdbe06771a41c1452d72b2abccccaf5e2e4
MD5 059c4bd2179ec22c96751c9d2f945e6e
BLAKE2b-256 49766d5401a8927c03b45d4fb8a23b7c91830830d788b5d81cf85160bbd9bae6

See more details on using hashes here.

File details

Details for the file nasbench_pytorch-1.2-py3-none-any.whl.

File metadata

  • Download URL: nasbench_pytorch-1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for nasbench_pytorch-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d4d503ad8c11a4c99d8f3ba3cea4aefa000bf747658163e92d069bf928b8255f
MD5 3ae30185ea53464070af0867263af5f8
BLAKE2b-256 5958b47a2d3e7d2bd4b46f8d660111db744a014ddb662f7975c6e31947f36b6a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page