ActivationFunc

Trait ActivationFunc 

Source
pub trait ActivationFunc {
    // Required methods
    fn func(x: f64) -> f64;
    fn func_grad(x: f64) -> f64;
    fn func_inv(x: f64) -> f64;
}
Expand description

Trait for activation functions in models.

Required Methods§

Source

fn func(x: f64) -> f64

The activation function.

Source

fn func_grad(x: f64) -> f64

The gradient of the activation function.

Source

fn func_inv(x: f64) -> f64

The inverse of the activation function.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§