Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class Initialize p where
- initialize :: (ContGen d, PrimMonad m) => d -> Gen (PrimState m) -> m p
- gInitialize :: (ADTRecord p, Constraints p Initialize, ContGen d, PrimMonad m) => d -> Gen (PrimState m) -> m p
- initializeNormal :: (Initialize p, PrimMonad m) => Double -> Gen (PrimState m) -> m p
- initializeSingle :: (ContGen d, PrimMonad m, Fractional p) => d -> Gen (PrimState m) -> m p
- reshapeR :: forall i j d m. (ContGen d, PrimMonad m, KnownNat i, KnownNat j) => d -> Gen (PrimState m) -> R i -> m (R j)
- reshapeLRows :: forall i j n d m. (ContGen d, PrimMonad m, KnownNat n, KnownNat i, KnownNat j) => d -> Gen (PrimState m) -> L i n -> m (L j n)
- reshapeLCols :: forall i j n d m. (ContGen d, PrimMonad m, KnownNat n, KnownNat i, KnownNat j) => d -> Gen (PrimState m) -> L n i -> m (L n j)
Documentation
class Initialize p where Source #
Class for types that are basically a bunch of Double
s, which can be
initialized with a given identical and independent distribution.
Nothing
initialize :: (ContGen d, PrimMonad m) => d -> Gen (PrimState m) -> m p Source #
initialize :: (ADTRecord p, Constraints p Initialize, ContGen d, PrimMonad m) => d -> Gen (PrimState m) -> m p Source #
Instances
gInitialize :: (ADTRecord p, Constraints p Initialize, ContGen d, PrimMonad m) => d -> Gen (PrimState m) -> m p Source #
initialize
for any instance of Generic
.
:: (Initialize p, PrimMonad m) | |
=> Double | standard deviation |
-> Gen (PrimState m) | |
-> m p |
Helper over inititialize
for a gaussian distribution centered around
zero.
initializeSingle :: (ContGen d, PrimMonad m, Fractional p) => d -> Gen (PrimState m) -> m p Source #
initialize
definition if p
is a single number.
Reshape
reshapeR :: forall i j d m. (ContGen d, PrimMonad m, KnownNat i, KnownNat j) => d -> Gen (PrimState m) -> R i -> m (R j) Source #
Reshape a vector to have a different amount of items If the matrix is grown, new weights are initialized according to the given distribution.