Draw a digit

Draw a number in the box. A Sparsr device running in this browser tab will read it, and tell you what it did to get there.

What is happening

The device stores ten hypervectors, one per digit, each 4,096 bits wide. They were built from 60,000 handwritten digits in the MNIST dataset: for every digit, the bits that most of its examples agree on.

Your drawing is turned into a hypervector the same way, and then compared against all ten. The comparison is a Hamming distance — how many of the 4,096 bits differ — and the nearest one wins.

On an ordinary processor that comparison is 128 separate 32-bit operations per digit. On Sparsr it is one instruction, because the register is 4,096 bits wide and counting the differing bits is a mode on the result path rather than a second step. Ten digits, ten comparisons, twenty instructions including the loads.

What this does not tell you

Nothing about speed. The device here is a software model running in your browser, so its wall-clock time is a property of your laptop and not of Sparsr. The instruction counts on the page are exact; there is deliberately no timing figure beside them, because a number that looked like a measurement would not be one.

It will misread some of your digits. The stored digits were trained on other people's handwriting, and this classifier is a deliberately simple one: it scores 76.96% on the 10,000-image MNIST test set. That is far above guessing and far below what a neural network does. It is here because every vector operation in it runs on the device, which is the thing worth showing.