Updated docstring for LSTM layer - Specifying order of outputs
* Updated the doc for LSTM layer. It was not clear what is the order of the
state elements (hidden vs. cell state) when using return_state=True.
* Updated doc for RNN layer accordingly.
@@ -293,7 +293,8 @@ class RNN(Layer):
# Output shape
- if `return_state`: a list of tensors. The first tensor is
the output. The remaining tensors are the last states,
- each with shape `(batch_size, units)`.
+ each with shape `(batch_size, units)`. For example, the number of
+ state tensors is 1 (for RNN and GRU) or 2 (for LSTM).
- if `return_sequences`: 3D tensor with shape
`(batch_size, timesteps, units)`.
- else, 2D tensor with shape `(batch_size, units)`.
@@ -2096,7 +2097,8 @@ class LSTM(RNN):
return_sequences: Boolean. Whether to return the last output
in the output sequence, or the full sequence.
return_state: Boolean. Whether to return the last state
- in addition to the output.
+ in addition to the output. The returned elements of the
+ states list are the hidden state and the cell state, respectively.
go_backwards: Boolean (default False).
If True, process the input sequence backwards and return the
reversed sequence.
