Simple Self-Contained Neural Network toolkit written on C++ (usefull as sample or tutorial)
// Create NN.Layers
auto IN = new NN::Layer(28*28, NN::TheNeuronFactory<NN::InputNeuron>()); IN->addNeurons(1,NN::TheNeuronFactory<NN::BiasNeuron>());
auto L1 = new NN::Layer(28*28, NN::TheNeuronFactory<NN::ProcNeuronTrainee>()); L1->addNeurons(1,NN::TheNeuronFactory<NN::BiasNeuron>());
auto OUT = new NN::Layer(10, NN::TheNeuronFactory<NN::ProcNeuronTrainee>()); // Outputs: 0="0", 1="1", 2="2", ...
// Connect layers
L1->addInputAll(IN);
OUT->addInputAll(L1);
// Create NN.Network by NN.Layers
NN::Network NET;
NET.addLayer(IN); NET.addLayer(L1); NET.addLayer(OUT);
// NN::doTrain(NET, DATAS, TARGS) // run training session
//std::vector<std::vector<double>> DATAS = [ [...], ... ]; // source data (each sample holds values for inputs)
//std::vector<std::vector<double>> TARGS = [ [...], ... ]; // expected results (each result holds expected outputs)
cout << "Training, please wait ...";
if (!NN::doTrain(NET, DATAS, TARGS))
{
cout << "Training failed!";
}
cout << "Training complete";
// NN::doProc(NET, DATA) // run single inference calculation
// std::vector<double> DATA Input (must have same count as number of inputs)
// Returns result std::vector<double> (will have same count as number of outputs)
auto CALC = NN::doProc(NET, DATA);
There is a NN engine implementation on JavaScript with (almost) the same API:
https://github.com/openlab-vn-ua/NNJS
- Steven Miller, "Mind: How to Build a Neural Network (Part One)"
http://stevenmiller888.github.io/mind-how-to-build-a-neural-network/ - Matt Mazur, "A Step by Step Backpropagation Example"
https://mattmazur.com/2015/03/17/a-step-by-step-backpropagation-example/ - Arnis71, "Introduction to neural networks" (on Russian)
https://habrahabr.ru/post/312450/
https://habrahabr.ru/post/313216/
https://habrahabr.ru/post/307004/