Watch a network learn, one update at a time.
ANN Visualizer
Neural Observatory makes learning inspectable: follow a handwritten digit through signals, loss, gradients, and a real optimizer update in a 3D network.
- JavaScript
- React
- Three.js
- React Three Fiber
- Web Workers
Private source · project overview

Begin with an untrained network
The observatory starts from seeded random weights, not a pretrained classifier. A handwritten MNIST digit feeds 784 inputs, two ReLU hidden layers, and ten softmax outputs. The default hidden layers have 16 units; a new run can use 8, 16, or 24. The visible digit is the first example in a minibatch, and both its true label and the model’s top prediction stay visible—even when the prediction is wrong.
Make the update part of the story
Input → Forward → Loss → Backward → Update → Compare is one recorded computation. A Web Worker loads the dataset, runs an explicit forward pass and backpropagation, and prepares the mean batch gradients. Reaching Update applies one SGD or Adam step. Compare evaluates the same batch with the new parameters. React readouts and the Three.js scene share these snapshots; TensorFlow.js is now a development reference for numerical checks, rather than the application’s training engine.
MNIST + SEEDED RUN → WORKER: PREPARE → RECORDED STEP
│ │
COMMIT AT UPDATE ▼
└────────── 3D SCENE + INSPECTOR
REPLAY / COMPAREPrepare the computation. Commit once. Inspect the record.
- 01 / main thread
useTraining
Seed + optimizer + batch size
Run-scoped worker requests
- initialize → 2. MNIST dataset
- prepare request → 3. prepare
- timeline reaches Update → 4. commit at Update
- 02 / worker input
MNIST dataset
Seeded minibatch sampling
64 fixed held-out probes
- minibatch → 3. prepare
- 03 / worker computation
prepare
Forward + cross-entropy + backward
Mean batch gradients; no update
- prepared snapshot → 5. Recorded training step
- mean gradients → 4. commit at Update
- 04 / optimizer boundary
commit at Update
SGD or Adam; one commit per step
Before / after + actual changes
- committed snapshot → 5. Recorded training step
- 05 / bounded history
Recorded training step
Input + traces + parameters
Last 32 steps; safe replay
- playhead / selection → 6. NetworkScene + Readouts
- 06 / shared presentation
NetworkScene + Readouts
Signals / gradients / updates
Neuron inspector + weight maps
- 1useTraining MNIST datasetinitialize
- 2useTraining prepareprepare request
- 3MNIST dataset prepareminibatch
- 4prepare Recorded training stepprepared snapshot
- 5useTraining commit at Updatetimeline reaches Update
- 6prepare commit at Updatemean gradients
- 7commit at Update Recorded training stepcommitted snapshot
- 8Recorded training step NetworkScene + Readoutsplayhead / selection
Read from the implementation
src/hooks/useTraining.jssrc/workers/worker.jssrc/model/network.jssrc/model/dataset.jssrc/model/playback.jssrc/scene/NetworkScene.jsxsrc/ui/Readouts.jsx
Replay a calculation without training twice
Pause, scrub, or replay a committed step to inspect its calculation. Replay moves through recorded states without applying another optimizer update. The history retains the last 32 steps; selecting an older step inspects a snapshot rather than restoring the model. The films follow the first four consecutive batches of a fresh default run, including mistakes, then replay the fourth step at the same speed. A gentle camera orbit keeps the spatial structure readable.
Follow a neuron back to its numbers
The Neuron panel connects the picture to z = Σ(aᵢ × wᵢ) + b: weighted contributions, bias, activation, and the displayed example’s derivative. Individual weights expose mean batch gradients and measured optimizer changes. Adam includes running moment estimates, so its actual update is not simply −learningRate × gradient. Signals follows the forward computation, then switches to gradients in Backward and changes in Update; signed blue and orange edges use fixed, clipped display scales.
Keep the picture honest
The default scene shows the eight strongest pixel links into each first hidden neuron and every connection between later layers: 544 visible links out of 12,960 model connections. Scene filtering changes the view, not the computation. Weight tiles reshape each first-layer neuron’s 784 learned parameters into a 28 × 28 map; they are not input digits. Loss history records pre-update mean batch loss, which can rise when the batch changes. The accuracy probe covers 64 fixed held-out digits, not the full test set, and one update can worsen an individual prediction.

