perceptron implementation changed + perceptronLearningAlgorithm and tests

This commit is contained in:
2016-03-08 23:10:38 +01:00
parent 4ef010b965
commit a48298b342
7 changed files with 97 additions and 7 deletions

16
tests/perceptron.cpp Normal file
View File

@@ -0,0 +1,16 @@
#include <NeuralNetwork/FeedForward/Perceptron.h>
#include <assert.h>
#include <iostream>
int main() {
NeuralNetwork::FeedForward::Perceptron p(2,1);
p[1].weight(0)=-1.0;
p[1].weight(1)=1.001;
assert(p.computeOutput({1,1})[0] == 1.0);
p[1].weight(1)=0.999;
assert(p.computeOutput({1,1})[0] == 0.0);
}