Back to Projects

RNNs from Scratch

Explore the mathematics of recurrence, implement custom PyTorch cells, and visualize hidden state dynamics over sequential data.

Part 1

The Math of Recurrence

Deconstructing the mathematics of parameter sharing across time, backpropagation through time (BPTT), and the vanishing gradient problem.

Part 2

Building the Architecture

Translating recurrence equations into pure PyTorch code, managing cell states, and stacking multi-layer bidirectional architectures.
View Code on GitHub

Part 3

Training & Dynamics

Analyzing hidden state trajectories, training convergence, and comparing recurrent integration against fully attention-based Transformers.