- class avalanche.benchmarks.utils.AvalancheDataset(datasets: Sequence[IDataset[T_co]], *, indices: List[int] | None = None, data_attributes: List[DataAttribute] | None = None, transform_groups: TransformGroups | None = None, frozen_transform_groups: TransformGroups | None = None, collate_fn: Callable[[List], Any] | None = None)
Avlanche dataset are pytorch-compatible Datasets with some additional functionality such as: - management of transformation groups via
AvalancheTransform- support for sample attributes such as class targets and task labels
Avalanche datasets manage sample-wise information such as class or task labels via
Avalanche datasets manage transformation via transformation groups. Simply put, a transformation group is a named preprocessing function (as in torchvision datasets). By default, Avalanche expects two transformation groups: - ‘train’, which contains transformations applied to training patterns. - ‘eval’, that contain transformations applied to test patterns.
Having both groups allows to use different transformations during training and evaluation and to seamlessly switch between them by using the
eval()methods. Arbitrary transformation groups can be added and used. If you define custom groups, you can use them by calling the :func:with_transforms method.
switching to a different transformation group by calling the
eval()or ``with_transforms` methods always returns a new dataset, levaing the original one unchanged.
Ttransformation groups can be manipulated by removing, freezing, or replacing transformations. Each operation returns a new dataset, leaving the original one unchanged.
- __init__(datasets: Sequence[IDataset[T_co]], *, indices: List[int] | None = None, data_attributes: List[DataAttribute] | None = None, transform_groups: TransformGroups | None = None, frozen_transform_groups: TransformGroups | None = None, collate_fn: Callable[[List], Any] | None = None)
dataset – Original dataset. Beware that AvalancheDataset will not overwrite transformations already applied by this dataset.
transform_groups – Avalanche transform groups.
__init__(datasets, *[, indices, ...])
Concatenate this dataset with other.
Returns a new dataset with the transformations of the 'eval' group loaded.
Returns a new dataset with the transformation groups frozen.
Recursively remove transformation groups from dataset tree.
Recursively remove the current transformation group from the dataset tree and replaces it.
Subset this dataset.
Returns a new dataset with the transformations of the 'train' group loaded.
Return a new dataset with the added or replaced data attribute.
Returns a new dataset with the transformations of a different group loaded.