Skip to content

atzuur/mnist-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mnist-c

C implementation of a neural network for classification. model classifying "5" with 99.8% confidence

Performance

Using default settings training takes about 1.5s per epoch on my Ryzen 5 2600.

Architecture

Three fully connected layers (64-32-10 by default) with sigmoid activations in between, though this is trivially modifiable.

Usage

Training

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

Prediction

  1. Draw a 28x28 MNIST-like image (see demo)
  2. Convert to raw floating point using e.g. FFmpeg:
ffmpeg -v error -i YOUR_IMAGE.png -pix_fmt grayf32 -f rawvideo YOUR_IMAGE
  1. Run prediction using the model:
./a.exe YOUR_IMAGE

References

About

Neural network for image recognition

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published