Inkwell

Ink a digit and watch the exact network from 3Blue1Brown think, flat or in 3D. Every neuron and weighted connection is live, and the matrix maths run in hand-written WGSL compute shaders on your GPU, checked live against a plain JavaScript version. No machine-learning or graphics libraries.

draw a digit

Draw a centred, upright digit that fills the box. Trained on centred MNIST digits, so very off-centre or tiny strokes may confuse it.

positive weightnegative weight
drag to pan, scroll to zoom, double click to reset

95.8% on the MNIST test set. That is test-set accuracy on centred MNIST digits, not a claim about all handwriting.

Educational, not state of the art. Modern convolutional networks exceed 99.7%. This is deliberately the small, legible network so you can see every neuron and weight: a 784-16-16-10 perceptron, about 13,000 parameters.

Switch between the flat view and 3D with the toggle. In flat view, drag to pan and scroll to zoom. In 3D, drag to orbit, scroll or pinch to zoom, and double click to reset. Hover any neuron in either view to see its incoming weights: a hidden-layer-1 neuron shows its 784 weights as a 28x28 image, the pattern it looks for. Blue is a positive weight, red is negative.

The matrix multiplies run in hand-written WGSL compute shaders on your GPU, and a plain JavaScript version of the same network runs alongside as a check. The neuron and connection view is drawn in raw WebGPU as well, in both the flat and 3D layouts.

About

Built by Dr. Safeer Ali Mirani, GPU / XR / real-time visualisation engineer (PhD).

safeer.ali.mirani@gmail.com · Portfolio · GitHub · LinkedIn

Data: the MNIST database of handwritten digits (Yann LeCun, Corinna Cortes, Christopher Burges). The images here are the canonical MNIST files, checksum verified against the original distribution.

Inspired by 3Blue1Brown's "But what is a neural network?", and in the spirit of Adam Harley's interactive digit visualisation. Rebuilt as the flat perceptron with inference in raw WebGPU compute.

Compute: the model trained offline in NumPy. Weights are frozen and embedded in this page. Live inference runs on your GPU, and a plain JavaScript copy checks it on every stroke.