mxnet-nn-0.0.1.3: Train a neural network with MXNet in Haskell.

Safe HaskellNone
LanguageHaskell2010

MXNet.NN.DataIter.Class

Synopsis

Documentation

type family DatasetConstraint (d :: * -> *) (m :: * -> *) :: Constraint Source #

Constraints on Dataset and the monad where the operation shall be ran.

class Dataset (d :: * -> *) where Source #

Abstract Dataset type class

Minimal complete definition

fromListD, zipD, sizeD, forEachD

Methods

fromListD :: [e] -> d e Source #

Create Dataset from `[]`. note that depending on the instance, it may or may not work with infinitive list.

zipD :: d e1 -> d e2 -> d (e1, e2) Source #

Zip two Datasets

sizeD :: (DatasetConstraint d m, Monad m) => d e -> m Int Source #

Get number of elements

forEachD :: (DatasetConstraint d m, Monad m) => d e -> (e -> m a) -> m [a] Source #

Apply a function on each element of Dataset

forEachD_i :: (DatasetConstraint d m, Monad m) => d e -> ((Int, e) -> m a) -> m [a] Source #

Apply a function on each element of Dataset together with the element's index. Note that the default implmentation assumes the Dataset can be created from a infinitive list.

forEachD_ni :: (DatasetConstraint d m, Monad m) => d e -> (((Int, Int), e) -> m a) -> m [a] Source #

Apply a function on each element of Dataset together with the total number of elements and the element's index.

Instances

Dataset LVec Source # 

Methods

fromListD :: [e] -> LVec e Source #

zipD :: LVec e1 -> LVec e2 -> LVec (e1, e2) Source #

sizeD :: (DatasetConstraint LVec m, Monad m) => LVec e -> m Int Source #

forEachD :: (DatasetConstraint LVec m, Monad m) => LVec e -> (e -> m a) -> m [a] Source #

forEachD_i :: (DatasetConstraint LVec m, Monad m) => LVec e -> ((Int, e) -> m a) -> m [a] Source #

forEachD_ni :: (DatasetConstraint LVec m, Monad m) => LVec e -> (((Int, Int), e) -> m a) -> m [a] Source #