Git Product home page Git Product logo

multiplication-free-dnn's Introduction

Full-stack Optimization for Accelerating CNNs Using Powers-ofTwo Weights with FPGA Validation

This codebase requires PyTorch 1.0. Please refer to net.py for PyTorch layer definitions. Custom CUDA kernals for quantization (log and linear) and shift layers are in kernels/. This codebase uses Label Refinery for improved model performance.

We use a custom data loader which loads the entire ImageNet into memory (~200GB) before training (required due to network drives). This can be swapped out for the standard PyTorch dataloader and should lead to similar model performance.

Quantized Powers-of-two training (smaller model ~1.5M weights)

python train.py --dataset-root <dataset folder> --dataset imagenet --batch-size 1024 \
                --epochs 140 --lr-type cosine --lr 0.256 --aug + --save-path <save path> \
                --teacher-path <pretrained resnet50 path> --filters 128 512 512 512 1024  \
                --layers 4 4 4 4 1 --strides 1 2 2 2 1 --groups 2 8 8 8 8 --max-weight-exp 0 \
                --weight-levels 8 --layer-type quant --bn-type quant-bn --n-class 1000 \
                --input-size 224 --reshape-stride 4 --gamma 0.4 --in-memory

multiplication-free-dnn's People

Contributors

bradmcdanel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jawaechan

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.