Giter VIP home page Giter VIP logo

single-path-one-shot-nas's Introduction

Single-Path-One-Shot-NAS

license python pytorch

This repo provides a Pytorch-based implementation of SPOS(Single Path One-Shot Neural Architecture Search with Uniform Sampling) by Zichao Guo, and et. al. SPOS

It only contains 'Block Search' for reference. It's very time consuming to train this supernet on ImageNet, which makes it impossible for me to finish the experiment under limited resources. Therefore, I mainly focused on CIFAR-10.

Great thanks to Zichao Guo for his advice on some details. Nevertheless, some differences may still exists when compared with the official version such as data preprocessing and some other hyper parameters.

Environments

Python==3.7.10, Pytorch==1.7.1, CUDA==10.2, cuDNN==7.6.5 

Dataset

CIFAR-10 can be automatically downloaded using this code. ImageNet needs to be manually downloaded and here are some instructions.

Usage

  1. Train a supernet on the CIFAR-10 dataset by simply running:
bash scripts/train_supernet.sh
  • My pretrained supernet can be downloaded from this link.
  1. For convenience, I conduct random search by enumerating 1,000 paths to select the best:
bash scripts/random_search.sh
  • During my search, the best path is [1, 0, 3, 1, 3, 0, 3, 0, 0, 3, 3, 0, 1, 0, 1, 2, 2, 1, 1, 3].
  • In the original SPOS paper, they adopted the evolutionary algorithm to search architectures. Please refer to their official repo for more details.
  1. Use the best searched path to modify the "choice" defined in Line 116 of retrain_best_choice.py and re-train the corresponding architecture of this path:
bash scripts/retrain_best_choice.py
  • After retraining, the best test accuracy of this searched architecture is 93.31. The checkpoint is provided here.
  1. As I fix all seeds in the above procedures, same results should be achieved. You can check my logs in the logdir.

Reference

[1] Single Path One-Shot Neural Architecture Search with Uniform Sampling

[2] Differentiable architecture search for convolutional and recurrent networks

single-path-one-shot-nas's People

Contributors

shunlu91 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.