This class implements a layer that performs time convolution on a set of sequences. Zero-padding and dilated convolution are supported.
void SetFilterSize( int filterSize );
void SetFilterCount( int filterCount );
Set up the filters' size and number.
void SetStride( int stride );
Sets the convolution stride. The default value is 1
.
void SetPadding( int padding );
Specifies how many zero elements should be added at either end of a sequence before performing convolution. For example, if you set SetPadding( 1 );
two zeros will be added to the sequence - one at the start and one at the finish. The default value is 0
, that is, no padding used.
void SetDilation( int dilation );
Sets the step value for dilated convolution. Dilated convolution applies the filter not to the consecutive elements of the original sequence but to the elements with the gaps of specified size between them.
By default, this value is equal to 1
: no dilation, consecutive elements are used.
CPtr<CDnnBlob> GetFilterData() const;
The filters are represented by a blob of the following dimensions:
BatchLength
is equal to1
BatchWidth
is equal toGetFilterCount()
Height
is equal toGetFilterSize()
Width
is equal to1
Depth
is equal to1
Channels
is equal to the inputs'Height * Width * Depth * Channels
CPtr<CDnnBlob> GetFreeTermData() const;
The free terms are represented by a blob of the total size equal to the number of filters used (GetFilterCount()
).
Each input accepts a blob with several sequences. The dimensions of all inputs should be the same:
BatchLength
- the sequences' lengthBatchWidth * ListSize
- the number of sequences in the setHeight * Width * Depth * Channels
- the size of each element in the sequences.
For each input the layer has one output. It contains a blob with the result of the convolution. The output blob dimensions are:
BatchLength
can be calculated from the input as(2 * Padding + BatchLength - (1 + Dilation * (FilterSize - 1)))/Stride + 1
.BatchWidth
is equal to the inputs'BatchWidth
.ListSize
is equal to the inputs'ListSize
.Height
is equal to1
.Width
is equal to1
.Depth
is equal to1
.Channels
is equal toGetFilterCount()
.