CSubSequenceLayer Class
June 14, 2020 ยท View on GitHub
The class implements a layer that extracts a subsequence from each vector sequence of the set.
Settings
Subsequence start
void SetStartPos(int startPos);
Sets the position of the first element of the subsequence. For startPos >= 0, the position will be counted from the start of the original sequence. For startPos < 0 it will be counted from the end, with -1 standing for the last element of the original sequence.
Subsequence length
void SetLength(int length);
Sets the length of the subsequence to be extracted. If length > 0, the order of elements is the same as in the original. If length < 0, the order is reversed.
The length of the subsequence actually extracted will be not greater than abs(length), but may be smaller if the specified length would not fit into the original after starting at the specified position.
Reverse the original sequence
void SetReverse();
Sets the length and starting position so that the original will be reversed as a whole, without changing its length.
Trainable parameters
The layer has no trainable parameters.
Inputs
The single input accepts a blob with a set of objects; the objects are numbered along the BatchLength dimension of this blob.
Outputs
The single output returns a blob with the subsequence of objects, of the following dimensions:
BatchLengthis equal to the smaller value out ofabs(GetLength()and the maximum length of the subsequence for which it still fits into the original.- The rest of the dimensions are equal to the input dimensions.