Code Monkey home page Code Monkey logo

nsa's Introduction

A PyTorch implementation for Understanding and Exploring the Network with Stochastic Architectures, Zhijie Deng, Yinpeng Dong, Shifeng Zhang, and Jun Zhu (NeurIPS 2020)

Usage

Dependencies

  • python 3
  • torch 1.4.0
  • torchvision

Scripts for training and evaluating NSA as well as baselines:

Vanilla NSA:

python main_s.py --arch wrn_r --epochs 300 --schedule 90 180 240 --droppath_rate 0. --num_ensemble 100 --decay 5e-4 --arch_seed_start 1 --arch_seed_end 5 --arch_p 0.7 --aux --aux_weight 0.1 --job-id snet-1_5-r-p0.7-aux0.1-long-bn-noaggr-ba --use_bn --batch_arch

NSA-i:

python main_s.py --arch wrn_r --epochs 300 --schedule 90 180 240 --droppath_rate 0. --num_ensemble 100 --decay 5e-4 --arch_seed_start 1 --arch_seed_end 5 --arch_p 0.7 --aux --aux_weight 0.1 --job-id snet-1_5-r-p0.7-aux0.1-long-bn-noaggr --use_bn

NSA-id (only aggr)

python main_s.py --arch wrn_r --epochs 300 --schedule 90 180 240 --droppath_rate 0. --num_ensemble 100 --decay 5e-4 --learn_aggr --arch_seed_start 1 --arch_seed_end 5 --arch_p 0.7 --aux --aux_weight 0.1 --job-id snet-1_5-r-p0.7-aux0.1-long-bn --use_bn

NSA-id:

python main_s.py --arch wrn_r --epochs 300 --schedule 90 180 240 --droppath_rate 0. --num_ensemble 100 --decay 5e-4 --learn_aggr --arch_seed_start 1 --arch_seed_end 5 --arch_p 0.7 --aux --aux_weight 0.1 --job-id snet-1_5-r-p0.7-aux0.1-long

Wide resnet 28-10 in our implementation:

python main_s.py --arch wrn_r --epochs 300 --schedule 90 180 240 --dropout_rate 0. --num_ensemble 1 --decay 5e-4 --learn_aggr --arch_type residual --aux --aux_weight 0.1 --job-id resnet-r-aux0.1-long

Wide resnet 28-10 with MC dropout:

python main_s.py --arch wrn_r --epochs 300 --schedule 90 180 240 --dropout_rate 0.2 --num_ensemble 100 --decay 5e-4 --learn_aggr --arch_type residual --aux --aux_weight 0.1 --job-id resnet-r-aux0.1-dp0.2-long

Individual training:

python main_s.py --arch wrn_r --epochs 300 --schedule 90 180 240 --droppath_rate 0. --num_ensemble 100 --decay 5e-4 --learn_aggr --arch_seed_start 1 --arch_seed_end 1 --arch_p 0.7 --aux --aux_weight 0.1 --job-id snet-1_1-r-p0.7-aux0.1-long

Contact and cooperate

If you have any problem about this library or want to contribute to it, please send us an Email at:

Cite

Please cite our paper if you use this code in your own work:

PlaceHolder

nsa's People

Contributors

thudzj avatar

Stargazers

 avatar

Watchers

 avatar  avatar

nsa's Issues

Some questions regarding the paper

Sorry to bother you again!

Don't quite understand the following description.
According to this reasoning, why BN in the normal network is inconsistent during training and testing, which also uses the same architecture for each batch.

image

validate criterion is not defined

Hi, @thudzj

Congratulations on your great work on NIPS2020!
But I meet a name error when running this repository, specifically, the name criterion for validation is not defined.

image

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.