Added quantization layer into caffe (support a coarse level fixed point simulation). The working flow
is to insert the newly-built QuantizationLayer
between computation data path. It will round the
output of the previous layer using the specified round method and strategy under a pre-determined
bit width.
Only 3 files needed to be added to the original Caffe framework (https://github.com/BVLC/caffe).
quantization_layer.hpp
: header file forQuantizationLayer
, add to$CAFFE_ROOT/include/caffe/layers
QuantizationLayer.cpp
: source file forQuantizationLayer
, add to$CAFFE_ROOT/src/caffe/layers
caffe.proto
: Added id = 147QuantizationParameter
forQuantizationLayer
, replace the original one at$CAFFE_ROOT/src/caffe/proto
Re-Compile the Caffe framework and PyCaffe/MatCaffe if you use the Python/Matlab Interface.
Three IPython Notebooks are provided to demonstrate how to use PyCaffe for manipulating the
QuantizationLayer
.