#[cfg(not(feature = "f32"))]
use core::f64::consts::E;
#[cfg(not(feature = "f32"))]
use libm::pow;
#[cfg(feature = "f32")]
use core::f32::consts::E;
#[cfg(feature = "f32")]
use micromath::F32Ext;
use super::Float;
pub struct Activation<'a> {
pub function: &'a dyn Fn(Float) -> Float,
pub derivative: &'a dyn Fn(Float) -> Float
}
#[cfg(not(feature = "f32"))]
pub const SIGMOID: Activation = Activation {
function: &|x| 1.0 / (1.0 + pow(E, -x)),
derivative: &|x| x * (1.0 - x)
};
#[cfg(feature = "f32")]
pub const SIGMOID: Activation = Activation {
function: &|x| 1.0 / (1.0 + E.powf(-x)),
derivative: &|x| x * (1.0 - x)
};