Table Of Contents
Table Of Contents

gluonts.dataset.loader module

class gluonts.dataset.loader.BatchBuffer(batch_size: int, ctx: mxnet.context.Context, dtype: gluonts.core.component.DType = <class 'numpy.float32'>)[source]

Bases: object

add(d: Dict[str, List[numpy.ndarray]])[source]
next_batch() → Dict[str, Any][source]
shuffle()[source]
stack(xs)[source]
class gluonts.dataset.loader.DataLoader(dataset: gluonts.dataset.common.Dataset, transform: gluonts.transform.Transformation, batch_size: int, ctx: mxnet.context.Context, dtype: gluonts.core.component.DType = <class 'numpy.float32'>)[source]

Bases: typing.Iterable

An abstract Iterable type for iterating and transforming a dataset, in batches of a prescribed size.

Parameters:
  • dataset – The dataset from which to load data.
  • transform – A transformation to apply to each entry in the dataset.
  • batch_size – The size of the batches to emit.
  • ctx – MXNet context to use to store data.
  • dtype – Floating point type to use.
class gluonts.dataset.loader.InferenceDataLoader(dataset: gluonts.dataset.common.Dataset, transform: gluonts.transform.Transformation, batch_size: int, ctx: mxnet.context.Context, dtype: gluonts.core.component.DType = <class 'numpy.float32'>)[source]

Bases: gluonts.dataset.loader.DataLoader

An Iterable type for iterating and transforming a dataset just once, in batches of a prescribed size.

The transformation are applied with in inference mode, i.e. with the flag is_train = False.

Parameters:
  • dataset – The dataset from which to load data.
  • transform – A transformation to apply to each entry in the dataset.
  • batch_size – The size of the batches to emit.
  • ctx – MXNet context to use to store data.
  • dtype – Floating point type to use.
class gluonts.dataset.loader.TrainDataLoader(dataset: gluonts.dataset.common.Dataset, transform: gluonts.transform.Transformation, batch_size: int, ctx: mxnet.context.Context, num_batches_per_epoch: int, dtype: gluonts.core.component.DType = <class 'numpy.float32'>, shuffle_for_training: bool = True, num_batches_for_shuffling: int = 10)[source]

Bases: gluonts.dataset.loader.DataLoader

An Iterable type for iterating and transforming a dataset, in batches of a prescribed size, until a given number of batches is reached.

The transformation are applied with in training mode, i.e. with the flag is_train = True.

Parameters:
  • dataset – The dataset from which to load data.
  • transform – A transformation to apply to each entry in the dataset.
  • batch_size – The size of the batches to emit.
  • ctx – MXNet context to use to store data.
  • num_batches_per_epoch – Number of batches to return in one complete iteration over this object.
  • dtype – Floating point type to use.
class gluonts.dataset.loader.ValidationDataLoader(dataset: gluonts.dataset.common.Dataset, transform: gluonts.transform.Transformation, batch_size: int, ctx: mxnet.context.Context, dtype: gluonts.core.component.DType = <class 'numpy.float32'>)[source]

Bases: gluonts.dataset.loader.DataLoader

An Iterable type for iterating and transforming a dataset just once, in batches of a prescribed size.

The transformation are applied with in training mode, i.e. with the flag is_train = True.

Parameters:
  • dataset – The dataset from which to load data.
  • transform – A transformation to apply to each entry in the dataset.
  • batch_size – The size of the batches to emit.
  • ctx – MXNet context to use to store data.
  • dtype – Floating point type to use.