This is the flat, top-down companion to the 3D Neural Network — Backpropagation simulator, which draws the same architecture with a WebGL camera and glowing panels. Here the diagram is a genuine flat 2D canvas drawing — no camera, no depth, no orbit controls — but the mathematics underneath is identical and just as real: a matrix forward pass, chain-rule backpropagation and per-example gradient descent, computed from scratch in plain JavaScript arrays.
- Forward pass — each layer computes
z = W·x + b, then applies the activation to get a = f(z).
- Backpropagation — the output error is propagated backwards layer by layer using the chain rule, producing the gradient of the loss with respect to every weight and bias.
- Gradient descent — each weight moves a small step (the learning rate) opposite its gradient, every training example, every epoch.
- Blue lines are positive weights, red lines are negative weights; line thickness and opacity both scale with magnitude.
- The right-hand panel is a live decision boundary — click it to test any point.