pub fn tanh(x: f32) -> f32
Expand description
Calculates the hyperbolic tangent activation function for a given input.
x
- A 32-bit float input value.
let x = 0.5;
let result = cgl_rs::math::activations::tanh(x);
println!("tanh({}) = {}", x, result);