← jstn.ch

neuralnet-from-scratch

2026 · NumPy, PyTorch · MNIST, EMNIST · Source

Draw a digit from 0 to 9.

What the
network sees

Draw in the box to see the network’s guess.

Neural network guess.

How it works

A 784 → 16 → 16 → 10 network with ReLU hidden layers and a softmax output, trained with plain SGD (learning rate 0.1, batches of 100, 10 epochs) on the 60,000 MNIST training digits. Your drawing is cropped, scaled and centred.

ImplementationTest accuracy
NumPy, from scratch95.00 ± 0.27%
PyTorch, same network95.07 ± 0.31%
10,000 MNIST test images, mean ± standard deviation over 10 runs.