28 — Sequence Models

RNN — Recurrent Networks#

Sequential✓ Mathematical
◆ The PatternProcessing sequences by passing hidden state through time

RNNs process sequences step-by-step, maintaining a hidden state h that carries memory of previous inputs.

hₜ = tanh(Wₕ·hₜ₋₁ + Wₓ·xₜ + b)
hₜ = new hidden state  |  same weights reused at every timestep
// RNN unrolled through time
Seq length4
Click Animate
Vanishing gradient: Gradients shrink exponentially over many timesteps. LSTM and GRU solve this with gated memory.
Pattern bridge: Hidden state flowing through time steps is sequential memory — like exponential moving averages where each value inherits from the past.
← Previous
Normalization Variants
Open in the full reader, with the topic sidebar →