RotatedMNIST#
- class capymoa.ocl.datasets.RotatedMNIST[source]#
Bases:
_TorchVisionDownload,_BuiltInRotatedDomainScenarioRotated MNIST where each task applies a fixed image rotation.
- __init__(
- num_tasks: int | None = None,
- rotations: Sequence[float] | None = None,
- shuffle_data: bool = True,
- seed: int = 0,
- directory: Path = get_download_dir(),
- auto_download: bool = True,
- train_transform: Callable[[Any], Tensor] | None = None,
- test_transform: Callable[[Any], Tensor] | None = None,
- normalize_features: bool = False,
- preload_test: bool = True,
- preload_train: bool = False,
- test_loaders( ) Sequence[DataLoader[Tuple[Tensor, Tensor]]][source]#
Get the training streams for the scenario.
- Parameters:
batch_size – Collects vectors in batches of this size.
kwargs – Additional keyword arguments to pass to the DataLoader.
- Returns:
A data loader for each task.
- train_loaders( ) Sequence[DataLoader[Tuple[Tensor, Tensor]]][source]#
Get the training streams for the scenario.
The order of the tasks is fixed and does not change between iterations. The datasets themselves are shuffled in
__init__()if shuffle_data is set to True. This is because the order of data is important in online learning since the learner can only see each example once.
- Parameters:
batch_size – Collects vectors in batches of this size.
kwargs – Additional keyword arguments to pass to the DataLoader.
- Returns:
A data loader for each task.
- default_rotation_max = 180.0#
- default_test_transform: Callable[[Any], Tensor] | None = ToTensor()#
The default transform to apply to the dataset.
- default_train_transform: Callable[[Any], Tensor] | None = ToTensor()#
The default transform to apply to the dataset.
- mean: Sequence[float] | None = [0.1307]#
The mean of the features in the dataset used for normalization.
- std: Sequence[float] | None = [0.3081]#
The standard deviation of the features in the dataset used for normalization.
- stream: Stream[LabeledInstance]#
Stream containing each task in sequence.
- task_mask: Tensor#
A mask for the output for each task of shape (num_tasks, num_classes)