lstm
Long short-term memory
Syntax
Description
The long short-term memory (LSTM) operation allows a network to learn long-term dependencies between time steps in time series and sequence data.
applies a long short-term memory (LSTM) calculation to input Y
= lstm(X
,H0
,C0
,weights
,recurrentWeights
,bias
)X
using the
initial hidden state H0
, initial cell state C0
, and
parameters weights
, recurrentWeights
, and
bias
. The input X
must be a formatted
dlarray
. The output Y
is a formatted
dlarray
with the same dimension format as X
, except
for any "S"
dimensions.
The lstm
function updates the cell and hidden states using the
hyperbolic tangent function (tanh) as the state activation function. The
lstm
function uses the sigmoid function given by as the gate activation function.
[
also returns the hidden state and cell state after the LSTM operation.Y
,hiddenState
,cellState
] = lstm(X
,H0
,C0
,weights
,recurrentWeights
,bias
)
___ = lstm(___,
specifies additional options using one or more name-value arguments.Name=Value
)
Examples
Input Arguments
Name-Value Arguments
Output Arguments
Algorithms
Extended Capabilities
Version History
Introduced in R2019bSee Also
dlarray
| fullyconnect
| softmax
| dlgradient
| dlfeval
| gru
| attention