AI & ML Atlas
Neural NetworksalgorithmAnimated walkthrough
Backpropagation Through Time (BPTT)
Backpropagation applied to a recurrent network unrolled across time steps.
The idea
Unroll the RNN so each time step becomes a layer sharing the same weights, then backpropagate through all of them and sum the gradients for the shared weights. Repeated multiplication by the same matrix makes gradients vanish or explode, so truncated BPTT limits how far back it goes.
Watch it run
The pipeline lights up one step at a time. Use the controls to pause or step through it.
- 1Run the RNN forward over the sequence, storing every hidden state.
- 2Compute the loss at the outputs.
- 3Backpropagate from the last time step to the first.
- 4Add up the gradients for the shared weights.
- 5Update the weights.
1/5
Step by step
- 1Run the RNN forward over the sequence, storing every hidden state.
- 2Compute the loss at the outputs.
- 3Backpropagate from the last time step to the first.
- 4Add up the gradients for the shared weights.
- 5Update the weights.
Where it is used
Training RNNs, LSTMs and GRUs.
Watch out for
Memory and time grow with sequence length; truncate and clip gradients.