Activate

Trait Activate 

Source
pub trait Activate<T> {
    type Cont<U>;

    // Required method
    fn rho<F, U>(&self, f: F) -> Self::Cont<U>
       where F: FnMut(T) -> U;

    // Provided methods
    fn heavyside(&self) -> Self::Cont<T>
       where T: PartialOrd + One + Zero { ... }
    fn relu(&self) -> Self::Cont<T>
       where T: PartialOrd + Zero { ... }
    fn sinh(&self) -> Self::Cont<T>
       where T: Float { ... }
    fn tanh(&self) -> Self::Cont<<T as Tanh>::Output>
       where T: Tanh { ... }
}
Expand description

Activate is a higher-kinded trait that provides a mechanism to apply a function over the elements within a container or structure.

Required Associated Types§

Source

type Cont<U>

Required Methods§

Source

fn rho<F, U>(&self, f: F) -> Self::Cont<U>
where F: FnMut(T) -> U,

Provided Methods§

Source

fn heavyside(&self) -> Self::Cont<T>
where T: PartialOrd + One + Zero,

Source

fn relu(&self) -> Self::Cont<T>
where T: PartialOrd + Zero,

Source

fn sinh(&self) -> Self::Cont<T>
where T: Float,

Source

fn tanh(&self) -> Self::Cont<<T as Tanh>::Output>
where T: 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.

Implementations on Foreign Types§

Source§

impl<S, D, A> Activate<A> for ArrayBase<S, D, A>
where S: Data<Elem = A>, D: Dimension, A: Clone,

Source§

type Cont<U> = ArrayBase<OwnedRepr<U>, D>

Source§

fn rho<F, U>(&self, f: F) -> Self::Cont<U>
where F: FnMut(A) -> U,

Implementors§