Step through a character sequence and observe how the forget, input, and output gates
control the flow of information in a Long Short-Term Memory cell.
LSTM equations:
The cell uses three gates (each a sigmoid) and a candidate memory (tanh):
\(f_t = \sigma(W_f [h_{t-1}, x_t] + b_f)\),
\(i_t = \sigma(W_i [h_{t-1}, x_t] + b_i)\),
\(o_t = \sigma(W_o [h_{t-1}, x_t] + b_o)\),
\(\tilde{C}_t = \tanh(W_C [h_{t-1}, x_t] + b_C)\).
Then \(C_t = f_t \odot C_{t-1} + i_t \odot \tilde{C}_t\) and \(h_t = o_t \odot \tanh(C_t)\).
t = 0 / 11
LSTM Cell Diagram
Gate Values at Current Step
Press Step or Play to begin.
State Evolution
Cell State C_t (line chart over time)
Hidden State h_t (bar chart)
Candidate ~C_t (bar chart)
Sequence Progress
Gate Computation Detail
Step through the sequence to see gate computations.