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
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步