pub trait Activation<U, T, R, D>where
    U: UnitValue<U>,
    D: Device<U>,
{ fn apply(&self, device: &D, input: &T) -> Result<R, EvaluateError>; fn derive(&self, device: &D, o: &T, loss: &T, u: &T) -> Result<R, TrainingError>; fn is_canonical_link<L: LossFunction<U>>(&self, l: &L) -> bool; }
Expand description

Trait defining activation functions

Required Methods§

Apply the activation function

Arguments
  • device - Device objects available for processing
  • input - input
Errors

This function may return the following errors

Apply derivatives of the activation function

Arguments
  • device - Device objects available for processing
  • o - Input from upper layers
  • loss - Losses calculated at lower tiers
  • u - Value before passing through the activation function of the input from the upper layer
Errors

This function may return the following errors

Returns whether or not the canonical linkage function can be used.

Arguments
  • l - loss function

Implementors§