Created
July 28, 2023 12:41
-
-
Save hietalajulius/720cd57ece945ee0f5ea8c3bc45a6838 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Perform backward pass through the ReLU activation function. | |
fn backward(&mut self, dL_dy: &Array2<f64>) -> Array2<f64> { | |
// Calculate dL/dx = dL/dy * dy/dx | |
dL_dy * &self.dy_dx.clone().expect("Need to call forward() first.") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment