16 lines
311 B
C++
16 lines
311 B
C++
#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);
|
|
} |