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§
Sourcefn linear(&self) -> Self::Cont<U>
fn linear(&self) -> Self::Cont<U>
the linear activation function is essentially a passthrough function, simply cloning the content.
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,
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.