Learn R Programming

torch (version 0.1.0)

dataset: An abstract class representing a Dataset.

Description

All datasets that represent a map from keys to data samples should subclass it. All subclasses should overwrite get_item, supporting fetching a data sample for a given key. Subclasses could also optionally overwrite lenght, which is expected to return the size of the dataset by many ~torch.utils.data.Sampler implementations and the default options of ~torch.utils.data.DataLoader.

Usage

dataset(name = NULL, inherit = Dataset, ..., parent_env = parent.frame())

Arguments

name

a name for the dataset. It it's also used as the class for it.

inherit

you can optionally inherit from a dataset when creating a new dataset.

...

public methods for the dataset class

parent_env

An environment to use as the parent of newly-created objects.