Skip to content

Instantly share code, notes, and snippets.

@hietalajulius
Created July 28, 2023 12:37
Show Gist options
  • Save hietalajulius/f45d63387df3df87bf3bb5d3e1c75f69 to your computer and use it in GitHub Desktop.
Save hietalajulius/f45d63387df3df87bf3bb5d3e1c75f69 to your computer and use it in GitHub Desktop.
/// Get the output of the ReLU activation function.
fn get_output(&self, x: &Array2<f64>) -> Array2<f64> {
// Apply ReLU function element-wise to input x
x.mapv(|val| f64::max(val, 0.0))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment