#include <SimdLib.h>
Data Fields | |
| size_t | srcC |
| size_t | srcH |
| size_t | srcW |
| SimdTensorDataType | srcT |
| SimdTensorFormatType | srcF |
| size_t | dstC |
| size_t | dstH |
| size_t | dstW |
| SimdTensorDataType | dstT |
| SimdTensorFormatType | dstF |
| size_t | kernelY |
| size_t | kernelX |
| size_t | dilationY |
| size_t | dilationX |
| size_t | strideY |
| size_t | strideX |
| size_t | padY |
| size_t | padX |
| size_t | padH |
| size_t | padW |
| size_t | group |
| SimdConvolutionActivationType | activation |
Detailed Description
Describes convolution and deconvolution geometry, tensor types and activation.
This structure is passed to convolution, deconvolution and merged-convolution initialization functions. For convolution, destination spatial size must satisfy:
dstH = (srcH + padY + padH - (dilationY*(kernelY - 1) + 1)) / strideY + 1 dstW = (srcW + padX + padW - (dilationX*(kernelX - 1) + 1)) / strideX + 1
For deconvolution, destination spatial size must satisfy:
dstH = strideY*(srcH - 1) + dilationY*(kernelY - 1) + 1 - padY - padH dstW = strideX*(srcW - 1) + dilationX*(kernelX - 1) + 1 - padX - padW
The weight tensor contains kernelY*kernelX*srcC*dstC/group elements. A depthwise convolution is represented by group == srcC == dstC.
Field Documentation
◆ srcC
| size_t srcC |
Number of input tensor channels (C dimension of the source tensor).
◆ srcH
| size_t srcH |
Input tensor height (H dimension of the source tensor).
◆ srcW
| size_t srcW |
Input tensor width (W dimension of the source tensor).
◆ srcT
| SimdTensorDataType srcT |
Input tensor element type.
◆ srcF
| SimdTensorFormatType srcF |
Input tensor memory format. Convolution implementations support NCHW or NHWC.
◆ dstC
| size_t dstC |
Number of output tensor channels (C dimension of the destination tensor).
◆ dstH
| size_t dstH |
Output tensor height (H dimension of the destination tensor).
◆ dstW
| size_t dstW |
Output tensor width (W dimension of the destination tensor).
◆ dstT
| SimdTensorDataType dstT |
Output tensor element type.
◆ dstF
| SimdTensorFormatType dstF |
Output tensor memory format. It normally has to match srcF.
◆ kernelY
| size_t kernelY |
Kernel height.
◆ kernelX
| size_t kernelX |
Kernel width.
◆ dilationY
| size_t dilationY |
Dilation along the Y axis. A value of 1 means adjacent kernel rows.
◆ dilationX
| size_t dilationX |
Dilation along the X axis. A value of 1 means adjacent kernel columns.
◆ strideY
| size_t strideY |
Stride along the Y axis.
◆ strideX
| size_t strideX |
Stride along the X axis.
◆ padY
| size_t padY |
Zero padding before the input image along the Y axis (top padding).
◆ padX
| size_t padX |
Zero padding before the input image along the X axis (left padding).
◆ padH
| size_t padH |
Zero padding after the input image along the Y axis (bottom padding).
◆ padW
| size_t padW |
Zero padding after the input image along the X axis (right padding).
◆ group
| size_t group |
Number of convolution groups. srcC and dstC are split by this value.
◆ activation
| SimdConvolutionActivationType activation |
Activation function applied after convolution/deconvolution accumulation and bias addition.