Giter Club home page Giter Club logo

nas's Introduction

NAS(Neural Architecture Search)

FBNet

  • Hardware-Aware Efficient ConvNet Design via Differentiable Neural Architecture Search Implementation of FBNet with MXNet

paper address: https://arxiv.org/pdf/1812.03443.pdf

Implemented Net:

  • FBNet
  • FBNet Based on Se_Resnet_50_Architecture

other block_type architecture cound be easily implement by modify fbnet-symbol/block.py

Code:

  • blocks.py: Define blocks symbols
  • FBNet.py: Define FBNet Class.
  • FBNet_SE.py: Define FBNet Architecture based on Se_resnet_50.
  • blocks_se.py: Define blocks symbols based on new search space,include [Resnet_50,Se,Group_Conv,Channel_shuffle,Deform_Conv]
  • util.py: Define some functions.
  • test.py: Run test.
  • block_speed_test.py: test block lat in real environment(1080Ti)

Differences from original paper:

  • The last conv layer's num_filters is repalced by feature_dim specified by paramters
  • Use Amsoftmax, Arcface instead of FC, but you can set model_type to softamx to use fc
  • Default input shape is 3,108,108, so the first conv layer has stride 1 instead of 2.
  • Add BN out of blocks, and no bn inside blocks.
  • Last conv has kernel size 3,3
  • Use + in loss not *.
  • Adding gradient rising stage in cosine decaying schedule. Code in fbnet-symbom/util/CosineDecayScheduler_Grad

How to train:

If you want to modify the network structure or the learning rate adjustment function, you need to modify the source code, otherwise you can use this command directly:

python test.py --gpu 0,1,2,3,4,5,6  --log-frequence 50 --model-type softmax --batch-size 32 

How to retrain:

When we want to train the large dataset and hope to change learning rate manually, or the machine is suddenly shutdown due to some reason, of course, we definitely hope we can continue to train model with previous trained weights. Then, your can use this cmd:

python test.py --gpu 0,1,2,3,4,5,6  --log-frequence 50 --model-type softmax --batch-size 32 --load-model-path ./model

This can load the latest model params for retrain,If you want to load the model with specific epoch, you can use ** --load-model-path ./model/*.params **,This means you can retrain your model from specific model.

TODO:

  • sample script, for now just save $\theta$
  • cosine decaying schedule
  • lat in real environment
  • DataParallel implementation

nas's People

Contributors

junrq avatar

Stargazers

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