neuralpp/examples/learnAdd.cpp

24 lines
606 B
C++
Raw Normal View History

2009-02-18 00:19:29 +01:00
/**
* This source creates a new neural network able to sum two integer numbers,
* using the training input set saved on "adder.xml" and saving output network
* on "adder.net"
*
* by BlackLight, 2009
*/
#include <iostream>
#include <neural++.hpp>
2009-02-18 00:19:29 +01:00
using namespace neuralpp;
int main() {
2009-08-09 19:53:21 +02:00
NeuralNet net(2, 2, 1, 0.005, 1000);
2009-02-18 00:19:29 +01:00
cout << "Training in progress - This may take a while...if it gets stuck, interrupt and restart the app\n";
net.train("adder.xml", NeuralNet::file);
2009-02-18 00:19:29 +01:00
net.save("adder.net");
2009-02-18 00:19:29 +01:00
cout << "Network trained. You can use adder.net file now to load this network\n";
return 0;
}