utils#

This package contains utility functions used by all datasets, including the base dataset class (ContinualDataset).

Functions#

datasets.utils.build_torchvision_transform(transform_specs)[source]#

Builds the transformation pipeline from the given specifications.

Parameters:

transform_specs (List[dict]) – the specifications of the transformations

Returns:

the transformation pipeline

Return type:

transforms.Compose

datasets.utils.get_default_args_for_dataset(dataset_name)[source]#

Get the default arguments defined by set_default_from_args for the given dataset.

Parameters:

dataset_name (str) – the name of the dataset

Returns:

the default arguments for the dataset

Return type:

dict

datasets.utils.is_static_call(*args)[source]#

Check if the function is called without any arguments.

Returns:

True if the function is called without any arguments, False otherwise.

Return type:

bool

datasets.utils.load_dataset_config(dataset_config, dataset)[source]#

Loads the configuration file for the dataset.

Parameters:
  • dataset_config (str) – the name of the configuration file

  • dataset (str) – the name of the dataset

Returns:

the configuration of the dataset

Return type:

dict

datasets.utils.set_default_from_args(arg_name)[source]#

Decorator to define the default value of an argument of a given dataset.

Parameters:

arg_name (str) – The name of the argument to set the default value for.

Returns:

The decorator to set the default value of the argument.

Return type:

function