Skip to content

Commit

Permalink
Fix backpropagation random error (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmonllao authored and akondas committed Nov 20, 2017
1 parent ff80af2 commit 333598b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/Phpml/Classification/MLPClassifierTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,16 @@ public function testBackpropagationPartialTraining(): void
public function testBackpropagationLearningMultilayer(): void
{
// Multi-layer 2 classes.
$network = new MLPClassifier(5, [3, 2], ['a', 'b']);
$network = new MLPClassifier(5, [3, 2], ['a', 'b', 'c']);
$network->train(
[[1, 0, 0, 0, 0], [0, 1, 1, 0, 0], [1, 1, 1, 1, 1], [0, 0, 0, 0, 0]],
['a', 'b', 'a', 'b']
['a', 'b', 'a', 'c']
);

$this->assertEquals('a', $network->predict([1, 0, 0, 0, 0]));
$this->assertEquals('b', $network->predict([0, 1, 1, 0, 0]));
$this->assertEquals('a', $network->predict([1, 1, 1, 1, 1]));
$this->assertEquals('b', $network->predict([0, 0, 0, 0, 0]));
$this->assertEquals('c', $network->predict([0, 0, 0, 0, 0]));
}

public function testBackpropagationLearningMulticlass(): void
Expand Down

0 comments on commit 333598b

Please sign in to comment.