neural-0.1.1.0: Neural Networks in native Haskell

Copyright(c) Lars Brünjes, 2016
LicenseMIT
Maintainerbrunjlar@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Numeric.Neural.Pipes

Description

This modules provides a "pipes"-based API for working with models.

Synopsis

Documentation

data TS f g a b c Source

The training state of a model.

Constructors

TS 

Fields

tsModel :: Model f g a b c

updated model

tsGeneration :: Int

generation

tsEta :: Double

learning rate

tsBatchError :: Double

last training error

descentP Source

Arguments

:: (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.

simpleBatchP Source

Arguments

:: MonadRandom m 
=> [a]

all available samples

-> Int

the mini-batch size

-> Producer [a] m r 

A simple Producer of mini-batches.

reportTSP Source

Arguments

:: 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.

consumeTSP Source

Arguments

:: 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.