Trait Rho

Source
pub trait Rho<U>: Apply<U> {
    // Provided methods
    fn linear(&self) -> Self::Cont<U> { ... }
    fn linear_derivative(&self) -> Self::Cont<U::Output>
       where U: One { ... }
    fn heavyside(&self) -> Self::Cont<U::Output>
       where U: Heavyside { ... }
    fn heavyside_derivative(&self) -> Self::Cont<U::Output>
       where U: Heavyside { ... }
    fn relu(&self) -> Self::Cont<U::Output>
       where U: ReLU { ... }
    fn relu_derivative(&self) -> Self::Cont<U::Output>
       where U: ReLU { ... }
    fn sigmoid(&self) -> Self::Cont<U::Output>
       where U: Sigmoid { ... }
    fn sigmoid_derivative(&self) -> Self::Cont<U::Output>
       where U: Sigmoid { ... }
    fn tanh(&self) -> Self::Cont<U::Output>
       where U: Tanh { ... }
    fn tanh_derivative(&self) -> Self::Cont<U::Output>
       where U: Tanh { ... }
}
Expand description

The Rho trait defines a set of activation functions that can be applied to an implementor of the Apply trait. It provides methods for common activation functions such as linear, heavyside, ReLU, sigmoid, and tanh, along with their derivatives. The trait is generic over a type U, which represents the data type of the input to the activation functions. The trait also inherits a type alias Cont<U> to allow for variance w.r.t. the outputs of defined methods.

Provided Methods§

Source

fn linear(&self) -> Self::Cont<U>

the linear activation function is essentially a passthrough function, simply cloning the content.

Source

fn linear_derivative(&self) -> Self::Cont<U::Output>
where U: One,

Source

fn heavyside(&self) -> Self::Cont<U::Output>
where U: Heavyside,

Source

fn heavyside_derivative(&self) -> Self::Cont<U::Output>
where U: Heavyside,

Source

fn relu(&self) -> Self::Cont<U::Output>
where U: ReLU,

Source

fn relu_derivative(&self) -> Self::Cont<U::Output>
where U: ReLU,

Source

fn sigmoid(&self) -> Self::Cont<U::Output>
where U: Sigmoid,

Source

fn sigmoid_derivative(&self) -> Self::Cont<U::Output>
where U: Sigmoid,

Source

fn tanh(&self) -> Self::Cont<U::Output>
where U: Tanh,

Source

fn tanh_derivative(&self) -> Self::Cont<U::Output>
where U: Tanh,

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§

Source§

impl<U, S> Rho<U> for S
where S: Apply<U>,