datasets#

Module attributes and functions#

Datasets can be included either by registering them using the register_dataset decorator or by following the old naming convention: - A single dataset is defined in a file named <dataset_name>.py in the datasets folder. - The dataset class must inherit from ContinualDataset.

datasets.get_all_datasets_legacy()[source]#

Returns the list of all the available datasets in the datasets folder that follow the old naming convention.

datasets.get_dataset(args)[source]#

Creates and returns a continual dataset among those that are available. If an error was detected while loading the available datasets, it raises the appropriate error message.

Parameters:

args (Namespace) – the arguments which contains the hyperparameters

Return type:

ContinualDataset

Exceptions:

AssertError: if the dataset is not available Exception: if an error is detected in the dataset

Returns:

the continual dataset instance

Return type:

ContinualDataset

datasets.get_dataset_class(args, return_args=False)[source]#

Return the class of the selected continual dataset among those that are available. If an error was detected while loading the available datasets, it raises the appropriate error message.

Parameters:
  • args (Namespace) – the arguments which contains the –dataset attribute

  • return_args (bool) – whether to return the parsable arguments of the dataset

Return type:

ContinualDataset

Exceptions:

AssertError: if the dataset is not available Exception: if an error is detected in the dataset

Returns:

the continual dataset class

Return type:

ContinualDataset

datasets.get_dataset_config_names(dataset)[source]#

Return the names of the available continual dataset configurations.

The configurations can be used to create a dataset with specific hyperparameters and can be specified using the –dataset_config attribute.

The configurations are stored in the datasets/configs/<dataset> folder.

datasets.get_dataset_names(names_only=False)[source]#

Return the names of the available continual dataset. If an error was detected while loading the available datasets, it raises the appropriate error message.

Parameters:

names_only (bool) – whether to return only the names of the available datasets

Exceptions:

AssertError: if the dataset is not available Exception: if an error is detected in the dataset

Returns:

the named of the available continual datasets

datasets.register_dataset(name)[source]#

Decorator to register a ContinualDatasety. The decorator may be used on a class that inherits from ContinualDataset or on a function that returns a ContinualDataset instance. The registered dataset can be accessed using the get_dataset function and can include additional keyword arguments to be set during parsing.

The arguments can be inferred by the signature of the dataset’s class. The value of the argument is the default value. If the default is set to Parameter.empty, the argument is required. If the default is set to None, the argument is optional. The type of the argument is inferred from the default value (default is str).

Parameters:

name (str) – the name of the dataset

Return type:

Callable