From ca9c0dc51173bd07f00d83daf7b3e768bd8d9f94 Mon Sep 17 00:00:00 2001 From: Matthias Guillitte Date: Tue, 24 Mar 2026 17:12:15 +0100 Subject: [PATCH] Misc Fixes for ADALINE --- .../NetworksTraining/ADALINEPerceptronTraining.php | 2 +- .../GradientDescentPerceptronTraining.php | 2 +- resources/js/components/IterationTable.vue | 9 +++++---- resources/js/components/PerceptronDecisionGraph.vue | 3 ++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/Models/NetworksTraining/ADALINEPerceptronTraining.php b/app/Models/NetworksTraining/ADALINEPerceptronTraining.php index f8ae11b..5462a31 100644 --- a/app/Models/NetworksTraining/ADALINEPerceptronTraining.php +++ b/app/Models/NetworksTraining/ADALINEPerceptronTraining.php @@ -90,7 +90,7 @@ class ADALINEPerceptronTraining extends NetworkTraining return $condition; } - private function iterationFunction(array $inputs, int $correctOutput) + private function iterationFunction(array $inputs, float $correctOutput): float { $output = $this->perceptron->test($inputs); diff --git a/app/Models/NetworksTraining/GradientDescentPerceptronTraining.php b/app/Models/NetworksTraining/GradientDescentPerceptronTraining.php index 925a890..3859318 100644 --- a/app/Models/NetworksTraining/GradientDescentPerceptronTraining.php +++ b/app/Models/NetworksTraining/GradientDescentPerceptronTraining.php @@ -86,7 +86,7 @@ class GradientDescentPerceptronTraining extends NetworkTraining return $condition; } - private function iterationFunction(array $inputs, int $correctOutput) + private function iterationFunction(array $inputs, float $correctOutput): float { $output = $this->perceptron->test($inputs); diff --git a/resources/js/components/IterationTable.vue b/resources/js/components/IterationTable.vue index b83dfa3..70aad49 100644 --- a/resources/js/components/IterationTable.vue +++ b/resources/js/components/IterationTable.vue @@ -33,9 +33,7 @@ const rowBgDark = computed(() => { Époch Exemple X{{ index }} @@ -60,7 +58,10 @@ const rowBgDark = computed(() => { {{ iteration.error.toFixed(2) }} - + Entraînement terminé : {{ props.trainingEndReason }} diff --git a/resources/js/components/PerceptronDecisionGraph.vue b/resources/js/components/PerceptronDecisionGraph.vue index adbbab0..f4a20e0 100644 --- a/resources/js/components/PerceptronDecisionGraph.vue +++ b/resources/js/components/PerceptronDecisionGraph.vue @@ -75,7 +75,7 @@ function getPerceptronDecisionBoundaryDataset( networkWeights[0][0].length <= 3 ) { // Unique, 3 weights perceptron - const perceptronWeights = networkWeights[0][0]; // We take the unique perceptron + const perceptronWeights = [...networkWeights[0][0]]; // Copy of the unique perceptron weights function perceptronLine(x: number): number { if (perceptronWeights.length < 3) { @@ -167,6 +167,7 @@ function getPerceptronDecisionBoundaryDataset(