Perceptron (unfinished)

This commit is contained in:
Niklas Birk
2019-06-23 13:48:53 +02:00
parent 84a1b61477
commit 5f9776c4ef
3 changed files with 29 additions and 16 deletions

View File

@ -16,18 +16,19 @@ class PerceptronTest
@BeforeAll
void initLearnData()
{
double biasUnit = 1d;
this.positives = new ArrayList<>(List.of(
new Vector(List.of(8d, 4d)),
new Vector(List.of(8d, 6d)),
new Vector(List.of(9d, 2d)),
new Vector(List.of(9d, 5d)))
new Vector(List.of(8d, 4d, biasUnit)),
new Vector(List.of(8d, 6d, biasUnit)),
new Vector(List.of(9d, 2d, biasUnit)),
new Vector(List.of(9d, 5d, biasUnit)))
);
this.negatives = new ArrayList<>(List.of(
new Vector(List.of(6d, 1d)),
new Vector(List.of(7d, 3d)),
new Vector(List.of(8d, 2d)),
new Vector(List.of(9d, 0d)))
new Vector(List.of(6d, 1d, biasUnit)),
new Vector(List.of(7d, 3d, biasUnit)),
new Vector(List.of(8d, 2d, biasUnit)),
new Vector(List.of(9d, 0d, biasUnit)))
);
}