C3dConvLayer Class
June 14, 2020 ยท View on GitHub
This class implements a layer that performs convolution on a set of three-dimensional multi-channel images. Zero-padding is supported.
Settings
Filters size
void SetFilterHeight( int filterHeight );
void SetFilterWidth( int filterWidth );
void SetFilterDepth( int filterDepth );
void SetFilterCount( int filterCount );
Sets the filters' size and number.
Convolution stride
void SetStrideHeight( int strideHeight );
void SetStrideWidth( int strideWidth );
void SetStrideDepth( int strideDepth );
Sets the convolution stride. By default, the stride is 1.
Padding
void SetPaddingHeight( int paddingHeight );
void SetPaddingWidth( int paddingWidth );
void SetPaddingDepth( int paddingDepth );
Sets the width, height, and depth of zero-padding that will be added around the image. For example, if you set the padding width to 1, two additional rectangles filled with zeros will be added to the image: one on the left and one on the right.
By default, no padding is used, and these values are equal to 0.
Using the free terms
void SetZeroFreeTerm(bool isZeroFreeTerm);
Specifies if the free terms should be used. If you set this value to true, the free terms vector will be set to all zeros and won't be trained. By default, this value is set to false.
Trainable parameters
Filters
CPtr<CDnnBlob> GetFilterData() const;
The filters are represented by a blob of the following dimensions:
BatchLength * BatchWidth * ListSizeis equal to the number of filters used (GetFilterCount())Heightis equal toGetFilterHeight()Widthis equal toGetFilterWidth()Depthis equal toGetFilterDepth()Channelsis equal to the inputs'Channels
Free terms
CPtr<CDnnBlob> GetFreeTermData() const;
The free terms are represented by a blob of the total size equal to the number of filters used (GetFilterCount()).
Inputs
Each input accepts a blob with several images. The dimensions of all inputs should be the same:
BatchLength * BatchWidth * ListSize- the number of images in the set.Height- the images' height.Width- the images' width.Depth- the images' depth.Channels- the number of channels the image format uses.
Outputs
For each input the layer has one output. It contains a blob with the result of the convolution. The output blob dimensions are:
BatchLengthis equal to the inputBatchLength.BatchWidthis equal to the inputBatchWidth.ListSizeis equal to the inputListSize.Heightcan be calculated from the inputHeightas(2 * PaddingHeight + Height - (1 + DilationHeight * (FilterHeight - 1)))/StrideHeight + 1.Widthcan be calculated from the inputWidthas(2 * PaddingWidth + Width - (1 + DilationWidth * (FilterWidth - 1)))/StrideWidth + 1.Depthcan be calculated from the inputDepthas
(2 * PaddingDepth + Depth - FilterDepth)/StrideDepth + 1.Channelsis equal toGetFilterCount().