Modification of BackPropagation added, some fixes and refactoring

This commit is contained in:
2014-11-11 22:06:16 +01:00
parent 42af5a4d2b
commit efbc8a4d1a
21 changed files with 588 additions and 94 deletions

View File

@@ -31,25 +31,23 @@ int main()
s.push_back(Shin::NeuronNetwork::Solution(std::vector<double>({0})));
p.push_back(X(std::vector<bool>({1})));
Shin::NeuronNetwork::FeedForwardNetworkQuick q({1,1});
Shin::NeuronNetwork::FeedForwardNetworkQuick q({1,5000,5000,1});
Shin::NeuronNetwork::Learning::BackPropagation b(q);
int i=0;
std::cerr << i%4 <<". FOR: [" << p[i%2].representation()[0] << "] res: " << q.solve(p[i%2])[0] << " should be " << s[i%2][0]<<"\n";
for(int i=0;i<2000;i++)
for(int i=0;i<5;i++)
{
b.teach(p[i%2],s[i%2]);
std::cerr << i%2 <<". FOR: [" << p[i%2].representation()[0] << "] res: " << q.solve(p[i%2])[0] << " should be " << s[i%2][0]<<"\n";
//b.teach(p[i%2],s[i%2]);
// std::cerr << i%2 <<". FOR: [" << p[i%2].representation()[0] << "] res: " << q.solve(p[i%2])[0] << " should be " << s[i%2][0]<<"\n";
}
b.debugOn();
for(int i=0;i<2;i++)
{
b.teach(p[i%2],s[i%2]);
// b.teach(p[i%2],s[i%2]);
std::cerr << i%4 <<". FOR: [" << p[i%4].representation()[0] << "," <<p[i%4].representation()[0] << "] res: " << q.solve(p[i%4])[0] << " should be " <<
s[i%4][0]<<"\n";
}
b.debugOff();
/*
for(int i=0;i<40;i++)
{