A specialized educational tool for visualizing the internal arithmetic of Recurrent Neural Networks (RNNs). This project allows students to step through the computations of UGRNN, GRU, and LSTM cells interactively.
No installation needed - runs directly in your browser!
- Node.js (v16 or higher) installed.
- Clone the repository or download the source code.
- Install dependencies:
npm install
Start the development server:
npm run devOpen your browser to:
http://localhost:3000
The application supports three common RNN architectures:
- UGRNN (Update Gate RNN): A simplified GRU.
- GRU (Gated Recurrent Unit): Standard gated unit.
- LSTM (Long Short-Term Memory): Complex cell with forget/input/output gates.
- Select a Model: Use the tabs at the top (UGRNN, GRU, LSTM).
-
Configure Inputs: Use the panel on the right to set input vector
$x_t$ and hidden state$h_{t-1}$ . You can also adjust gate biases. -
Step-by-Step Compute:
- Click the pulsing blue nodes to perform operations (sigmoid
$\sigma$ , tanh, addition, multiplication). - Watch the data flow through the lines.
- Vectors values are displayed at each step.
- Click the pulsing blue nodes to perform operations (sigmoid
- Advance Time: Once all computations for the current step are complete (all nodes green), click "Next Time Step" to feed the new hidden state back into the next iteration.
- Interactive Nodes: Click to trigger matrix multiplications and activations.
- Dynamic 1D-3D Vectors: Toggle between 1, 2, or 3-dimensional vectors to see how element-wise operations work.
-
Visual Gating: Explicitly visualize how gates (0 to 1) modulate information flow using the
$1 - z$ and$\times$ operations.
- React with TypeScript
- Vite for fast tooling
- SVG for high-performance custom diagrams
- Tailwind CSS for styling