Synapse-0.1.0.2: Synapse is a machine learning library written in pure Haskell.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Synapse.NN.Losses

Description

Provides collection of functions that are used to as a reference of what needs to be minimised during training.

LossFn type alias represents those functions, and Synapse offers a variety of them.

Synopsis

LossFn type alias and Loss newtype

type LossFn a = SymbolMat a -> SymbolMat a -> SymbolMat a Source #

LossFn type alias represents functions that are able to provide a reference of what relation between matrices needs to be minimised.

newtype Loss a Source #

Loss newtype wraps LossFns - differentiable functions that are able to provide a reference of what relation between matrices needs to be minimised.

Every loss function must return symbol of singleton matrix.

Constructors

Loss 

Fields

Regression losses

mse :: (Symbolic a, Floating a) => LossFn a Source #

Computes the mean of squares of errors.

msle :: (Symbolic a, Floating a) => LossFn a Source #

Computes the mean squared logarithmic error.

mae :: (Symbolic a, Floating a) => LossFn a Source #

Computes the mean of absolute error.

mape :: (Symbolic a, Floating a) => LossFn a Source #

Computes the mean absolute percentage error.

logcosh :: (Symbolic a, Floating a) => LossFn a Source #

Computes the logarithm of the hyperbolic cosine of the error.