rc-0.1.0.1: Reservoir Computing, fast RNNs

Safe HaskellNone
LanguageHaskell2010

RC.Helpers

Synopsis

Documentation

addBiases :: Matrix Double -> Matrix Double Source #

Prepend a row of ones

>>> addBiases $ (2><3) [20..26]
(3><3)
 [  1.0,  1.0,  1.0
 , 20.0, 21.0, 22.0
 , 23.0, 24.0, 25.0 ]

randList :: (Random a, Floating a) => Int -> StdGen -> [a] Source #

randMatrix Source #

Arguments

:: StdGen 
-> (Int, Int)

Number of rows and columns

-> (Double, Double)

Minimal and maximal values

-> Matrix Double 

Random matrix with elements in the range of [minVal; maxVal]

randSparse :: StdGen -> (Int, Int) -> (R, R) -> R -> Matrix R Source #

Random sparse matrix

NB: at the moment, the matrix is stored in memory as an ordinary (dense) matrix.

hsigmoid Source #

Arguments

:: (Fractional a, Ord a) 
=> (a, a, a)

Vertical scaling, width, offset

-> a 
-> a 

Hard sigmoid