neuralpp/examples/learnAdd.cpp

26 lines
581 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-08-16 11:09:42 +02:00
using namespace std;
2009-02-18 00:19:29 +01:00
using namespace neuralpp;
int main() {
NeuralNet net(2, 2, 2, 0.005, 1000);
2009-02-18 00:19:29 +01:00
2009-08-15 02:59:09 +02:00
cout << "Training in progress - This may take a while...\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;
}