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

Synapse.NN.Layers.Regularizers

Description

Provides collection of functions that impose penalties on parameters which is done by adding result to loss value.

Synopsis

RegularizerFn type alias and Regularizer newtype

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

RegularizerFn type alias represents functions that impose penalties on parameters which is done by adding result of regularization to loss value.

newtype Regularizer a Source #

Regularizer newtype wraps RegularizerFns - functions that impose penalties on parameters.

Every regularization function must return symbol of singleton matrix.

Constructors

Regularizer 

Fields

Regularizers

l1 :: (Symbolic a, Num a) => a -> RegularizerFn a Source #

Applies a L1 regularization penalty (sum of absolute values of parameter multiplied by a coefficient).

l2 :: (Symbolic a, Num a) => a -> RegularizerFn a Source #

Applies a L1 regularization penalty (sum of squared values of parameter multiplied by a coefficient).