CustomDataset
- class colibri.data.datasets.CustomDataset(name, path='data', builtin_train=True, builtin_download=True, transform_dict={})[source]
Bases:
Dataset
Custom dataset.
This class allows to load custom datasets and apply transformations to the data.
- The datasets that can be currently loaded are:
‘cifar10’
‘mnist’
‘fashion_mnist’
‘cave’
- This class is divided in two parts:
builtin datasets: datasets that are predefined in the repository.
custom datasets: datasets that are not predefined in the repository.
The builtin datasets are loaded using the function load_builtin_dataset from the module colibri.data.utils. The custom datasets are loaded using the function get_filenames from the module colibri.data.utils. The transformations are applied to the data using the torchvision.transforms module.
- The default transformations are:
input: transforms.ToTensor()
output: transforms.ToTensor()
- Parameters:
name (string) – Name of the dataset. Current options are: (‘cifar10’, ‘cifar100’, ‘mnist’, ‘fashion_mnist’, ‘cave’).
path (string) – Path to directory with the dataset.
builtin_train (bool) – Whether to load the training or test set. This option is only available for builtin datasets.
builtin_download (bool) – Whether to download the dataset if it is not found. This option is only available for builtin datasets.
transform_dict (dict,object) – Dictionary with the transformations to apply to the data.