Copyright | (c) Lars Brünjes, 2016 |
---|---|
License | MIT |
Maintainer | brunjlar@gmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Extensions | BangPatterns |
This modules provides a "pipes"-based API for working with models.
- data TS f g a b c = TS {
- tsModel :: Model f g a b c
- tsGeneration :: Int
- tsEta :: Double
- tsBatchError :: Double
- descentP :: (Foldable h, Monad m) => Model f g a b c -> Int -> (Int -> Double) -> Pipe (h a) (TS f g a b c) m r
- simpleBatchP :: MonadRandom m => [a] -> Int -> Producer [a] m r
- reportTSP :: Monad m => Int -> (TS f g a b c -> m ()) -> Pipe (TS f g a b c) (TS f g a b c) m r
- consumeTSP :: Monad m => (TS f g a b c -> m (Maybe x)) -> Consumer (TS f g a b c) m x
- module Pipes
Documentation
The training state of a model.
TS | |
|
:: (Foldable h, Monad m) | |
=> Model f g a b c | initial model |
-> Int | first generation |
-> (Int -> Double) | computes the learning rate from the generation |
-> Pipe (h a) (TS f g a b c) m r |
A Pipe
for training a model: It consumes mini-batches of samples from upstream and pushes
the updated training state downstream.
:: MonadRandom m | |
=> [a] | all available samples |
-> Int | the mini-batch size |
-> Producer [a] m r |
A simple Producer
of mini-batches.
:: Monad m | |
=> Int | report interval |
-> (TS f g a b c -> m ()) | report action |
-> Pipe (TS f g a b c) (TS f g a b c) m r |
A Pipe
for progress reporting of model training.
:: Monad m | |
=> (TS f g a b c -> m (Maybe x)) | check whether training is finished and what to return in that case |
-> Consumer (TS f g a b c) m x |
A Consumer
of training states that decides when training is finished and then returns a value.
module Pipes