Versioned name: LSTMSequence-1
Category: Sequence processing
Short description: LSTMSequence operation represents a series of LSTM cells. Each cell is implemented as LSTMCell operation.
Detailed description
A single cell in the sequence is implemented in the same way as in LSTMCell operation. LSTMSequence represents a sequence of LSTM cells. The sequence can be connected differently depending on direction
attribute that specifies the direction of traversing of input data along sequence dimension or specifies whether it should be a bidirectional sequence. The most of the attributes are in sync with the specification of ONNX LSTM operator defined LSTMCell.
Attributes
int
float[]
float
num_directions = 1
, if it is bidirectional, then num_directions = 2
. This num_directions
value specifies input/output shape requirements.string
Inputs
X
- 3D tensor of type T1 [batch_size, seq_length, input_size]
, input data. It differs from LSTMCell 1st input only by additional axis with size seq_length
. Required.initial_hidden_state
- 3D tensor of type T1 [batch_size, num_directions, hidden_size]
, input hidden state data. Required.initial_cell_state
- 3D tensor of type T1 [batch_size, num_directions, hidden_size]
, input cell state data. Required.sequence_lengths
- 1D tensor of type T2 [batch_size]
, specifies real sequence lengths for each batch element. Required.W
- 3D tensor of type T1 [num_directions, 4 * hidden_size, input_size]
, the weights for matrix multiplication, gate order: fico. Required.R
- 3D tensor of type T1 [num_directions, 4 * hidden_size, hidden_size]
, the recurrence weights for matrix multiplication, gate order: fico. Required.B
- 2D tensor of type T1 [num_directions, 4 * hidden_size]
, the sum of biases (weights and recurrence weights). Required.Outputs
Y
– 3D tensor of type T1 [batch_size, num_directions, seq_len, hidden_size]
, concatenation of all the intermediate output values of the hidden.Ho
- 3D tensor of type T1 [batch_size, num_directions, hidden_size]
, the last output value of hidden state.Co
- 3D tensor of type T1 [batch_size, num_directions, hidden_size]
, the last output value of cell state.Types
Example