From 16b6072d8036cb12a502682531f15b8d712f78cf Mon Sep 17 00:00:00 2001 From: lluni Date: Sat, 4 Feb 2023 17:45:31 +0100 Subject: [PATCH] Improved backward_pass of ActivationLayer --- src/layers/activation_layer.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/layers/activation_layer.rs b/src/layers/activation_layer.rs index 8aa53cf..8a271ed 100644 --- a/src/layers/activation_layer.rs +++ b/src/layers/activation_layer.rs @@ -30,8 +30,6 @@ impl Layer for ActivationLayer { } fn backward_pass(&mut self, output_error: ArrayView1, _learning_rate: f64) -> Array1 { - let mut temp = (self.activation_prime)(&self.input); - temp.zip_mut_with(&output_error, |x, y| *x *= y); - temp + (self.activation_prime)(&self.input) * output_error } }