Tinn (Tiny Neural Network)
Tinn (Tiny Neural Network) is a 200 line dependency free neural network library written in C99.
For a demo on how to learn hand written digits, get some training data:
wget http://archive.ics.uci.edu/ml/machine-learning-databases/semeion/semeion.data
make; ./test
The training data consists of hand written digits written both slowly and quickly. Each line in the data set corresponds to one handwritten digit. Each digit is 16x16 pixels in size giving 256 inputs to the neural network.
At the end of the line 10 digits signify the hand written digit:
0: 1 0 0 0 0 0 0 0 0 0
1: 0 1 0 0 0 0 0 0 0 0
2: 0 0 1 0 0 0 0 0 0 0
3: 0 0 0 1 0 0 0 0 0 0
4: 0 0 0 0 1 0 0 0 0 0
...
9: 0 0 0 0 0 0 0 0 0 1
This gives 10 outputs to the neural network. The test program will output the accuracy for each digit. Expect above 99% accuracy for the correct digit, and less that 0.1% accuracy for the other digits.
Features
-
Portable - Runs where a C99 or C++98 compiler is present.
-
Sigmoidal activation.
-
One hidden layer.
https://github.com/glouw/tinn