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::{ exp, Tensor };

#[allow(dead_code)]
pub fn tanh(x: &Tensor) -> Tensor {
    // (e^x - e^-x)/(e^x + e^-x)
    let z_1 = &exp(x) - &exp(&(-1.0 * x));
    let z_2 = &exp(x) + &exp(&(-1.0 * x));
    let tanh = &z_1 / &z_2;
    tanh
}