C implementation of a neural network for classification.
Using default settings training takes about 1.5s per epoch on my Ryzen 5 2600.
- MNIST Handwritten Digits dataset: ~97% accuracy
- Zalando Fashion-MNIST dataset: ~85% accuracy
Three fully connected layers (64-32-10 by default) with sigmoid activations in between, though this is trivially modifiable.
git clone https://github.com/atzuur/mnist-c
cd mnist-c
make # optionally add `CC=clang EXTRA="-fuse-ld=lld"` to use clang
./a.exe train
ffmpeg -v error -i YOUR_IMAGE.png -pix_fmt grayf32 -f rawvideo YOUR_IMAGE
- Run prediction using the model:
./a.exe YOUR_IMAGE
- Michael A. Nielsen, ‘Neural Networks and Deep Learning’. Determination Press, 2015, http://neuralnetworksanddeeplearning.com/.