Convolution Kernels Group¶
The Convolution Group describes operations related to convolution layers, where input features are convolved with a set of trained filters. For a comprehensive guide on convolution arithmetic details for various cases, see A guide to convolution arithmetic for deep learning.
Functions in this group use the mli_conv2d_cfg
structure, defined as:
typedef struct {
mli_relu_cfg relu;
uint8_t stride_width;
uint8_t stride_height;
uint8_t dilation_width;
uint8_t dilation_height;
uint8_t padding_left;
uint8_t padding_right;
uint8_t padding_top;
uint8_t padding_bottom;
} mli_conv2d_cfg;
Field Name |
Type |
Description |
---|---|---|
|
|
Type of ReLU activation applied to output values. See ReLU Prototype and Function List for more details. |
|
|
Stride of filter across width dimension of input |
|
|
Stride of filter across height dimension of input |
|
|
If set to k>1, there are k-1 implicitly added zero points between each filter point across width dimension. If set to 1, no dilation logic is used. Zero dilation is forbidden. |
|
|
If set to k>1, there are k-1 implicitly added zero points between each filter point across height dimension. If set to 1, no dilation logic is used. Zero dilation is forbidden. |
|
|
Number of zero points implicitly added to the left of input (width dimension) |
|
|
Number of zero points implicitly added to the right of input (width dimension) |
|
|
Number of zero points implicitly added to the top of input (height dimension) |
|
|
Number of zero points implicitly added to the bottom of input (height dimension) |
Note
For more information on dilation rate, see chapter 5.1 of A guide to convolution arithmetic for deep learning.
For all kernels in this group except the transpose convolution, spatial dimensions of
in
, weights
and out
tensors (Width and Height) must comply with the following
system of equations:
Where:
\(\hat{Wk}\), \(\hat{Hk}\) - effective
weights
kernel width and height after applying \(dilation\_width\) and \(dilation\_height\) factors on the original kernel width (\(Wk\)) and height (\(Hk\)).\(\hat{Wi}\), \(\hat{Hi}\) - effective
in
feature map width and height after applying \(padding\_*\) to the original width (\(Wi\)) and height (\(Hi\)).\(Wo\), \(Ho\) -
out
feature map width and height.