relu_1d

Function relu_1d 

Source
pub fn relu_1d(input_array: Array1<f64>) -> Array1<f64>
Expand description

Relu activation function for 1d array

More info: https://machinelearningmastery.com/rectified-linear-activation-function-for-deep-learning-neural-networks/

§Arguments

  • input_array: 1d array

returns: Array1<f64>

§Examples

use ducky_learn::activations::*;
use ndarray::arr1;

let input_array = arr1(&[-1.3456435325242, -32145324321., -132432888.]);
assert_eq!(relu_1d(input_array), arr1(&[0., 0., 0.]));