This project is an implementation of a classical neural network in plain C, with no dependencies other than the C standard library.
gcc
Use ./scripts/dbuild.sh
and ./scripts/build/drun.sh
to run the debug version
and ./scripts/rbuild.sh
and ./scripts/rrun.sh
for the release version.
Machine learning is working well, but may need some more optimizations to get a good neural network.
- Can train on IRIS in 0.02 seconds. (Run the
successcounter.py
script to test this yourself ONLY IFmain.c
is set to runiristest
instead ofmnisttest
.) - Can recognize handwritten digits with 75% accuracy in under 90 seconds.
- Backpropagation -- a hand-derived and hand-coded implementation of partial derivatives in a neural network.
- Learning rate adjustment -- adjusts learning rate based on the error of going a single step down in the gradient.
- Repeated descent -- calculates a gradient once and goes in that direction repeatedly to avoid expensive recalculation.
- Multithreading -- can multithread loss and gradient calculations for time-efficient calculation.