Idea · Aug 14, 2026
From-Scratch Neural Net with Live Visualization
Students implement a two-layer feedforward neural network in vanilla Python or TypeScript, then build a browser-based D3 visualization that animates forward-pass activations and gradient flow during backpropagation, culminating in a live-trainable demo on XOR or a 2D toy dataset.
What it would do
This assignment is a direct classroom application of the SIGCSE TS 2026 finding that students who build machine learning models from scratch score roughly 10% better on conceptual understanding than library-first students. The deliverable has two layers. Layer 1 (weeks 1-2): students implement, from scratch, a two-layer feedforward network including forward pass, sigmoid or ReLU activation, cross-entropy loss, and backpropagation via chain rule in pure Python (no NumPy, no PyTorch) or TypeScript. They write unit tests for each component. Layer 2 (weeks 3-4): students build a React + D3 frontend that consumes their network's internal state and visualizes it in real time: nodes sized by activation value, edges colored by weight sign and magnitude, a loss curve updating each epoch, and a decision-boundary overlay animating over a 2D scatter plot. The final demo lets visitors pause training mid-epoch, scrub backward through gradient history, and inspect any neuron's activation. The assignment teaches backpropagation conceptually (you cannot copy-paste what you have not internalized), professional toolchain discipline (code is tested before visualized), and data visualization design in one coherent arc.
Key features
- Vanilla implementation of forward pass, sigmoid/ReLU, cross-entropy loss, and backprop via chain rule (no ML libraries)
- Unit-tested network components with gradient-check tests
- Real-time D3 visualization: node activations, edge weights, loss curve, and decision boundary
- Pause, scrub, and inspect controls for mid-epoch exploration
- Configurable architecture (hidden layer size, learning rate, activation function) via a sidebar panel
- Demo mode: students train live in front of the class on XOR or a 2D dataset of their choosing