Method SinglePassLSTM
SinglePassLSTM(TensorFloat, TensorFloat, TensorFloat, TensorFloat, TensorInt, TensorFloat, TensorFloat, TensorFloat, TensorFloat, RnnActivation[], float[], float[], bool, float, bool, int, RnnLayout)
Computes a single pass LSTM either forward or reverse dirIndex and layout are used to calculate where to index the various tensors in bidirectional and batch first layout passes X has given layout W, R are cropped to single direction P, B are full number of directions Y has given layout and full number of directions (matches output of Layer) Y_h, Y_c are SequenceFirst layout and cropped to single direction HtxRT and XsixWT are temp vectors of the correct dimension for the intermediate results of the matmuls activations, activationAlpha and activationBeta have full number of dimensions
Declaration
protected override void SinglePassLSTM(TensorFloat X, TensorFloat W, TensorFloat R, TensorFloat B, TensorInt sequenceLens, TensorFloat P, TensorFloat Y, TensorFloat Y_h, TensorFloat Y_c, RnnActivation[] activations, float[] activationAlpha, float[] activationBeta, bool inputForget, float clip, bool isReverse, int dirIndex, RnnLayout layout)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
TensorFloat | W | The weights tensor. |
TensorFloat | R | The recurrence weights tensor. |
TensorFloat | B | The bias tensor. |
TensorInt | sequenceLens | Optional tensor specifying lengths of the sequences in a batch. |
TensorFloat | P | The weight tensor for the peepholes. |
TensorFloat | Y | The output tensor. |
TensorFloat | Y_h | The output tensor for the last hidden. |
TensorFloat | Y_c | The output tensor for the last cell. |
RnnActivation[] | activations | The activations. |
float[] | activationAlpha | The activation alpha value. |
float[] | activationBeta | The activation beta value. |
bool | inputForget | Whether to couple the input and forget gates. |
float | clip | The cell clip threshold. |
bool | isReverse | Whether the direction is reverse. |
int | dirIndex | Which pass this is in a bidirectional LSTM. |
RnnLayout | layout | The layout of the tensors. |