| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Synapse.NN.Batching
Contents
Description
Implements batching - technology that allows packing and processing multiple samples at once.
Synopsis
- data Sample a = Sample {
- sampleInput :: a
- sampleOutput :: a
- newtype Dataset a = Dataset {}
- datasetSize :: Dataset a -> Int
- shuffleDataset :: RandomGen g => Dataset a -> g -> (Dataset a, g)
- splitDataset :: Dataset a -> Float -> (Dataset a, Dataset a)
- type VecDataset a = Dataset (Vec a)
- type BatchedDataset a = Dataset (Mat a)
- batchVectors :: Int -> VecDataset a -> BatchedDataset a
Sample datatype
Sample datatype represents known pair of inputs and outputs of function that is unknown.
Constructors
| Sample | |
Fields
| |
Dataset datatype
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.