| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Synapse.NN.Layers.Constraints
Description
Allows to constraint values of layers parameters.
ConstraintFn type alias represents functions that are able to constrain the values of matrix
and Constraint newtype wraps ConstraintFns.
ConstraintFns should be applied on matrices from the updateParameters function.
Synopsis
- type ConstraintFn a = Mat a -> Mat a
- newtype Constraint a = Constraint {
- unConstraint :: ConstraintFn a
- nonNegative :: (Num a, Ord a) => ConstraintFn a
- clampMin :: Ord a => a -> ConstraintFn a
- clampMax :: Ord a => a -> ConstraintFn a
- clampMinMax :: Ord a => (a, a) -> ConstraintFn a
- centralize :: Fractional a => a -> ConstraintFn a
ConstraintFn type alias and Constraint newtype
type ConstraintFn a = Mat a -> Mat a Source #
ConstraintFn type alias represents functions that are able to constrain the values of matrix.
newtype Constraint a Source #
Constraint newtype wraps ConstraintFns - functions that are able to constrain the values of matrix.
Constructors
| Constraint | |
Fields
| |
Value constraints
nonNegative :: (Num a, Ord a) => ConstraintFn a Source #
Ensures that matrix values are non-negative.
clampMin :: Ord a => a -> ConstraintFn a Source #
Ensures that matrix values are more or equal than given value.
clampMax :: Ord a => a -> ConstraintFn a Source #
Ensures that matrix values are less or equal than given value.
clampMinMax :: Ord a => (a, a) -> ConstraintFn a Source #
Ensures that matrix values are clamped between given values.
Matrix-specific constraints
centralize :: Fractional a => a -> ConstraintFn a Source #
Ensures that matrix values are centralized by mean around given value.