sgd-0.7.0.1: Stochastic gradient descent

Safe HaskellNone
LanguageHaskell98

Numeric.SGD.DataSet

Contents

Description

Provides the DataSet type which abstracts over the actual (IO-based) representation of the training dataset.

Synopsis

Dataset

data DataSet elem Source #

Dataset stored on a disk

Constructors

DataSet 

Fields

  • size :: Int

    The size of the dataset; the individual indices are [0, 1, ..., size - 1]

  • elemAt :: Int -> IO elem

    Get the dataset element with the given identifier

shuffle :: DataSet a -> IO (DataSet a) Source #

Shuffle the dataset.

Reading

loadData :: DataSet a -> IO [a] Source #

Lazily load the entire dataset from a disk.

randomSample :: Int -> DataSet a -> IO [a] Source #

Random dataset sample with a specified number of elements (loaded eagerly)

Construction

withVect :: [a] -> (DataSet a -> IO b) -> IO b Source #

Construct dataset from a list of elements, store it as a vector, and run the given handler.

withDisk :: Binary a => [a] -> (DataSet a -> IO b) -> IO b Source #

Construct dataset from a list of elements, store it on a disk and run the given handler. Training elements must have the Binary instance for this function to work.