rotta_rs 0.0.5

a Deep Learning library with rust language
Documentation
1
2
3
4
5
6
7
8
9
10
use crate::rotta_rs_module::arrayy::*;

pub fn sign_arr(x: &Arrayy) -> Arrayy {
    let vector = x.value
        .iter()
        .map(|v| if *v > 0.0 { 1.0 } else if *v < 0.0 { -1.0 } else { 0.0 })
        .collect::<Vec<f64>>();

    Arrayy::from_vector(x.shape.clone(), vector)
}