CGruLayer Class
June 14, 2020 ยท View on GitHub
This class implements a GRU layer that works with a set of vector sequences.
The result is a vector sequence of the same length, with each vector the length of GetHiddenSize().
Settings
Trainable parameters
Gate weights matrix
CPtr<CDnnBlob> GetGateWeightsData() const;
The gate weights are put into a two-dimensional matrix represented by a blob of the dimensions:
BatchLength * BatchWidth * ListSizeis equal to2 * GetHiddenSize()Height * Width * Depth * Channelsis equal to the same dimension of the input plusGetHiddenSize().
Along the BatchLength * BatchWidth * ListSize axis the gate weights are sorted in the following order:
G_Update = 0, // Update gate
G_Reset, // Reset gate
Along the Height * Width * Depth * Channels axis the weights are put into following order:
- from the start to the input
Height * Width * Depth * Channelsthe weights for the input vectors - the rest
GetHiddenSize()coordinates correspond to the weights for the previous step result.
Gate free terms
CPtr<CDnnBlob> GetGateFreeTermData() const;
The free terms for the gates are represented by a blob of 2 * GetHiddenSize() total size.
Output weights matrix
CPtr<CDnnBlob> GetMainWeightsData() const;
The output weights are put into a two-dimensional matrix represented by a blob of the dimensions:
BatchLength * BatchWidth * ListSizeis equal toGetHiddenSize()Height * Width * Depth * Channelsis equal to the same dimension fo the input plusGetHiddenSize()
Output free terms
The free terms for the output are represented by a blob of GetHiddenSize() total size.
Inputs
The layer has 1 to 2 inputs:
- The set of vector sequences.
- [Optional] The initial previous step result that should be used on the first step. If you do not connect this input all zeros will be used.
Output
The single output returns a blob of the dimensions:
BatchLength,BatchWidth, andListSizeequal the corresponding input dimensionsHeight,Width, andDepthare equal to1ChannelsequalsGetHiddenSize()