Trait rusty_machine::learning::toolkit::activ_fn::ActivationFunc
source · [−]pub trait ActivationFunc: Clone + Debug {
fn func(x: f64) -> f64;
fn func_grad(x: f64) -> f64;
fn func_grad_from_output(y: f64) -> f64;
fn func_inv(x: f64) -> f64;
}
Expand description
Trait for activation functions in models.
Required Methods
sourcefn func_grad_from_output(y: f64) -> f64
fn func_grad_from_output(y: f64) -> f64
The gradient of the activation function calculated using the output of the function. Calculates f’(x) given f(x) as an input