This transformation converts Convolution to BinaryConvolution under following conditions: More...
#include <conv_to_binary_conv.hpp>
Data Fields | |
| NGRAPH_RTTI_DECLARATION | |
This transformation converts Convolution to BinaryConvolution under following conditions:
.... .... out_low out_high
| | | |
+--------------------------+ +-------------------------------------+
| FakeQuantize (levels==2) | | Constant |
| (on activations) | | (weights containing -1 or 1 values) |
+--------------------------+ +-------------------------------------+
| |
| |
----------------- -------------------
| |
v v
+-------------+
| Convolution |
+-------------+
|
v
is transformed to: .... .... out_low out_high
| | | |
+--------------------------+ +---------------------------------+
| FakeQuantize (levels==2) | | Constant (with u1 type) |
| (on activations) | | (with u1 type - binary weights) |
+--------------------------+ +---------------------------------+
| |
| |
----------------- -------------------
| |
v v
+-------------------+
| BinaryConvolution |
+-------------------+
|
v
+------------+ +----------------------------------------------------+
| | | Constant |
| Add | <---| (weights from original graph, |
| | | sum-reduced over [1,..., len(weights.shape)] axes |
+------------+ +----------------------------------------------------+
|
v
+------------+ +-----+
| Multiply | <---| 0.5 |
+------------+ +-----+
|
v