"use client"; import { motion } from "framer-motion"; import { COLORS, VizFrame } from "./common"; /** RNN cell unrolled across 4 time steps with shared weights highlighted. */ export function RNNUnroll({ width = 920, height = 340, }: { width?: number; height?: number; }) { const T = 4; const padX = 70; const stepW = (width - padX * 2) / T; const cellY = height / 2; return ( {Array.from({ length: T }, (_, t) => { const cx = padX + t * stepW + stepW / 2; return ( {/* Cell */} h_{t} {/* Input arrow from below */} x_{t} {/* Output arrow above */} y_{t} {/* Recurrent edge to next cell */} {t < T - 1 ? ( W ) : null} ); })} h_t = φ(W_x x_t + W_h h_(t-1) + b) · LSTM / GRU gate this recurrence ); }