abstract class MXNet::Gluon::Data::Dataset(T)

Overview

Abstract dataset.

All datasets should implement this interface.

Dataset includes Indexable, so subclasses must define #size, which returns the total number elements, and #unsafe_fetch, which returns the indexed element.

Included Modules

Direct Known Subclasses

Defined in:

mxnet/gluon/data/dataset.cr

Instance Method Summary

Instance Method Detail

abstract def size #
Description copied from module Indexable(T)

Returns the number of elements in this container.


[View source]
def transform(lazy = true, &proc : T -> U) forall U #

Returns a new dataset with each sample transformed by the supplied transformer block.

Parameters

  • lazy (Bool, default = true) If false, transforms all samples at once. Otherwise, transforms each sample on demand. Note that if the transformer block is stochastic, you must set lazy to true or you will get the same result on all epochs.

[View source]
abstract def unsafe_fetch(idx) #

[View source]