Dataset
classAll datasets that represent a map from keys to data samples should subclass this
class. All subclasses should overwrite the .getitem() method, which supports
fetching a data sample for a given key. Subclasses could also optionally
overwrite .length(), which is expected to return the size of the dataset
(e.g. number of samples) by many ~torch.utils.data.Sampler implementations
and the default options of dataloader()
.
dataset(
name = NULL,
inherit = Dataset,
...,
private = NULL,
active = NULL,
parent_env = parent.frame()
)
a name for the dataset. It it's also used as the class for it.
you can optionally inherit from a dataset when creating a new dataset.
public methods for the dataset class
passed to R6::R6Class()
.
passed to R6::R6Class()
.
An environment to use as the parent of newly-created objects.