arkgan 0.0.8

An open source GAN toolkit
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
pub fn calc_leaky_relu(x: &[f64]) -> Vec<f64>{
    let neg_slope: f64 = 0.01;
    let mut leaky_relu_val: Vec<f64> = vec![];
    for &elements in x{
        if elements >= 0.0{
            leaky_relu_val.push(elements);
        }else{
            // println!("Negative Slope: {}", neg_slope);
            let calc = neg_slope * elements;
            leaky_relu_val.push(calc);
        }
    }
    return leaky_relu_val;
}