MonoLayer Perceptron
This commit is contained in:
@@ -66,7 +66,7 @@ class ADALINEPerceptronTraining extends NetworkTraining
|
||||
foreach ($inputsForCurrentEpoch as $inputsWithLabel) {
|
||||
$inputs = array_slice($inputsWithLabel, 0, -1);
|
||||
$correctOutput = (float) end($inputsWithLabel);
|
||||
$output = $this->perceptron->test($inputs);
|
||||
$output = $this->perceptron->test($inputs)[0];
|
||||
$iterationError = $correctOutput - $output;
|
||||
$this->epochError += ($iterationError ** 2) / 2; // Squared error for the example
|
||||
}
|
||||
@@ -92,7 +92,7 @@ class ADALINEPerceptronTraining extends NetworkTraining
|
||||
|
||||
private function iterationFunction(array $inputs, float $correctOutput): float
|
||||
{
|
||||
$output = $this->perceptron->test($inputs);
|
||||
$output = $this->perceptron->test($inputs)[0];
|
||||
|
||||
$error = $correctOutput - $output;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user