Sequence Models · Intermediate

Recurrent Neural Network

Follow a recurrent hidden state through time and backpropagate the real sequence loss.

A focused simple RNN page teaches temporal state and parameter sharing before gated recurrent cells.

Step by step

  1. Read one sequence element.
  2. Combine it with the previous hidden state.
  3. Apply tanh.
  4. Predict from the final hidden state.
  5. Backpropagate through time.
  6. Update shared recurrent parameters.

Core formulas

RNN state

hₜ = tanh(Wₓxₜ + Wₕhₜ₋₁ + b)

The hidden state carries information from earlier sequence positions.

When to use Recurrent Neural Network

  • Learning temporal parameter sharing and BPTT.

Official documentation

TensorFlow RNN guide