Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- deParam :: forall p q pq s a b. (Backprop p, Backprop q) => (pq -> (p, q)) -> (p -> q -> pq) -> q -> (forall m. PrimMonad m => Gen (PrimState m) -> m q) -> Model (Just pq) s a b -> Model (Just p) s a b
- deParamD :: (Backprop p, Backprop q) => (pq -> (p, q)) -> (p -> q -> pq) -> q -> Model (Just pq) s a b -> Model (Just p) s a b
- reParam :: (forall z. Reifies z W => PMaybe (BVar z) q -> PMaybe (BVar z) p) -> (forall m z. (PrimMonad m, Reifies z W) => Gen (PrimState m) -> PMaybe (BVar z) q -> m (PMaybe (BVar z) p)) -> Model p s a b -> Model q s a b
- reParamD :: (forall z. Reifies z W => PMaybe (BVar z) q -> PMaybe (BVar z) p) -> Model p s a b -> Model q s a b
- dummyParam :: Model Nothing s a b -> Model p s a b
Documentation
:: (Backprop p, Backprop q) | |
=> (pq -> (p, q)) | split |
-> (p -> q -> pq) | join |
-> q | fixed param |
-> (forall m. PrimMonad m => Gen (PrimState m) -> m q) | fixed stoch param |
-> Model (Just pq) s a b | |
-> Model (Just p) s a b |
Fix a part of a parameter as constant, preventing backpropagation through it and not training it.
Treats a pq
parameter as essentialyl a (p, q)
, witnessed through the
split and join functions.
Takes the fixed value of q
, as well as a stochastic mode version with
fixed distribution.
:: (Backprop p, Backprop q) | |
=> (pq -> (p, q)) | split |
-> (p -> q -> pq) | join |
-> q | fixed param |
-> Model (Just pq) s a b | |
-> Model (Just p) s a b |
deParam
, but with no special stochastic mode version.
reParam :: (forall z. Reifies z W => PMaybe (BVar z) q -> PMaybe (BVar z) p) -> (forall m z. (PrimMonad m, Reifies z W) => Gen (PrimState m) -> PMaybe (BVar z) q -> m (PMaybe (BVar z) p)) -> Model p s a b -> Model q s a b Source #
Pre-applies a function to a parameter before a model sees it.
Essentially something like lmap
for parameters.
Takes a determinstic function and also a stochastic function for stochastic mode.