Git Product home page Git Product logo

Automatic Progressive Mixed-Precision Network Quantization

This resposity is the official implementation of our paper.

Dependencies

  • Python3.6
  • PyTorch >== 1.4.0

Params Settings

Please Kindly Refers To utils/option.py

Usage

  • Train-Float Baseline Models

    Please Kindly Refers to scripts/run.sh

## FLOAT BASELINE MODEL
python main/train.py \
        --arch=${ARCH} \
        --num_layers=${LAYERS} \
        --archtype=${ARCHTYPE} \
        --lr=0.001 --weight_decay=1e-4 \
        --train_batch_size=256 --k_bits=8 \
        --pre_k_bits=8 --ratio=1.0 \
        --mission=${MISSION} --gpus=0 \
        --train_epochs=300 --dataset=${DATASET} \
        --data_dir=/gdata/ImageNet2012/ \
        --job_dir=../outputs --clip \
        --resume=${RESUME}
  • Train-Quant Baseline Models

    Please Kindly Refers to scripts/run.sh

## Quant BASELINE MODEL
ARCHTYPE = quant
python main/train.py \
        --arch=${ARCH} \
        --num_layers=${LAYERS} \
        --archtype=${ARCHTYPE} \
        --lr=0.001 --weight_decay=1e-4 \
        --train_batch_size=256 --k_bits=8 \
        --pre_k_bits=8 --ratio=1.0 \
        --mission=${MISSION} --gpus=0 \
        --train_epochs=300 --dataset=${DATASET} \
        --data_dir=/gdata/ImageNet2012/ \
        --job_dir=../outputs --clip \
        --resume=${RESUME}
  • Mix-Precision Model Searching

    Please Kindly Refers to scripts/search.sh

# Mix-Precision Model Searching
python3 main/search.py \
    --step=${STEP} --lam=${LAMBDA} --interval=${INTERVAL}   \
    --ratio=${RATIO} --search_epochs=${SEARCH_EPOCHS}       \
    --dataset=${DATASET} --arch=${ARCH}  --lr=${LR}         \
    --num_layers=${LAYERS} --k_bits=8 --gpus=0              \
    --data_dir /userhome/memory_data/imagenet --clip        \
    --mission=${MISSION} --resume=${RESUME}
  • Computation Ratio

bash measure/compute.sh

Experiment Results

Quantization W-bits A-bits Acc.-1 Cost
Baseline 32 32 70.20 1.0000
ABC-Net 5 5 65.00 0.1563
Dorefa 5 5 68.40 0.1563
PACT 5 5 69.80 0.1563
ProQHA MP MP 70.01 0.1491
ABC-Net 3 3 61.00 0.0938
Dorefa 3 3 67.50 0.0938
PACT 3 3 68.10 0.0938
LQ-Nets 3 3 68.20 0.0938
ProQHA MP MP 68.34 0.0918

anonymous's Projects

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.