synapse-0.1.0.0: Synapse is a machine learning library written in pure Haskell.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Synapse.NN.Batching

Description

Implements batching - technology that allows packing and processing multiple samples at once.

Synopsis

Sample datatype

data Sample a Source #

Sample datatype represents known pair of inputs and outputs of function that is unknown.

Constructors

Sample 

Fields

Instances

Instances details
Show a => Show (Sample a) Source # 
Instance details

Defined in Synapse.NN.Batching

Methods

showsPrec :: Int -> Sample a -> ShowS #

show :: Sample a -> String #

showList :: [Sample a] -> ShowS #

Eq a => Eq (Sample a) Source # 
Instance details

Defined in Synapse.NN.Batching

Methods

(==) :: Sample a -> Sample a -> Bool #

(/=) :: Sample a -> Sample a -> Bool #

type DType (Sample a) Source # 
Instance details

Defined in Synapse.NN.Batching

type DType (Sample a) = DType a

Dataset datatype

newtype Dataset a Source #

Dataset newtype wraps vector of Samples - it represents known information about unknown function.

Constructors

Dataset 

Fields

Instances

Instances details
Show a => Show (Dataset a) Source # 
Instance details

Defined in Synapse.NN.Batching

Methods

showsPrec :: Int -> Dataset a -> ShowS #

show :: Dataset a -> String #

showList :: [Dataset a] -> ShowS #

Eq a => Eq (Dataset a) Source # 
Instance details

Defined in Synapse.NN.Batching

Methods

(==) :: Dataset a -> Dataset a -> Bool #

(/=) :: Dataset a -> Dataset a -> Bool #

type DType (Dataset a) Source # 
Instance details

Defined in Synapse.NN.Batching

type DType (Dataset a) = DType a

datasetSize :: Dataset a -> Int Source #

Returns size of dataset.

shuffleDataset :: RandomGen g => Dataset a -> g -> (Dataset a, g) Source #

Shuffles any Dataset using Fisher-Yates algorithm.

splitDataset :: Dataset a -> Float -> (Dataset a, Dataset a) Source #

Splits dataset such that size of left dataset divided on size of right dataset will be equal to given ratio.

type VecDataset a = Dataset (Vec a) Source #

VecDataset type alias represents Datasets with samples of vector functions.

type BatchedDataset a = Dataset (Mat a) Source #

BatchedDataset type alias represents Datasets with samples of vector functions where multiple samples were batched together.

batchVectors :: Int -> VecDataset a -> BatchedDataset a Source #

Batches VecDataset by grouping a given amount of samples into batches.