Trait Gradient

Source
pub trait Gradient<T, D> {
    type Repr<_A>;
    type Delta<_S, _D>;

    // Required method
    fn grad(
        &self,
        rhs: &Self::Delta<Self::Repr<T>, D>,
    ) -> Self::Delta<Self::Repr<T>, D>;
}
Expand description

the Gradient trait defines the gradient of a function, which is a function that takes an input and returns a delta, which is the change in the output with respect to the input.

Required Associated Types§

Source

type Repr<_A>

Source

type Delta<_S, _D>

Required Methods§

Source

fn grad( &self, rhs: &Self::Delta<Self::Repr<T>, D>, ) -> Self::Delta<Self::Repr<T>, D>

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§