Formula

RNN Encoder Hidden State Recurrence

Within a sequence-to-sequence encoder, an RNN processes the input sequence one token at a time. At each time step tt, the recurrent layer applies a transformation function ff that combines the input feature vector xt\mathbf{x}_t (derived from the ttht^{\textrm{th}} token xtx_t) with the hidden state ht1\mathbf{h}_{t-1} carried from the preceding time step to produce the updated hidden state ht\mathbf{h}_t:

ht=f(xt,ht1)\mathbf{h}_t = f(\mathbf{x}_t, \mathbf{h}_{t-1})

This recurrence captures how the encoder incrementally builds a representation of the input sequence, with each hidden state ht\mathbf{h}_t encoding information about all tokens observed up to and including position tt.

0

1

Updated 2026-05-14

Contributors are:

Who are from:

Tags

D2L

Dive into Deep Learning @ D2L