SplitMNIST#
- class capymoa.datasets.ocl.SplitMNIST[source]#
Bases:
_BuiltInCIScenario
Split MNIST dataset for online class incremental learning.
References:
LeCun, Y., Cortes, C., & Burges, C. (2010). MNIST handwritten digit database. ATT Labs [Online]. Available: http://yann.lecun.com/exdb/mnist
- num_classes: int = 10#
The number of classes in the dataset.
- default_task_count: int = 5#
The default number of tasks in the dataset.
- mean: Sequence[float] = [0.1307]#
The mean of the features in the dataset used for normalization.
- std: Sequence[float] = [0.3081]#
The standard deviation of the features in the dataset used for normalization.
- __init__(
- num_tasks: int | None = None,
- shuffle_tasks: bool = True,
- seed: int = 0,
- directory: Path = PosixPath('data'),
- auto_download: bool = True,
- train_transform: Callable[[Any], Tensor] | None = None,
- test_transform: Callable[[Any], Tensor] | None = None,
- normalize_features: bool = False,
Create a new online continual learning datamodule.
- Parameters:
num_tasks – The number of tasks to partition the dataset into, defaults to
default_task_count
.shuffle_tasks – Should the contents and order of the tasks be shuffled, defaults to True.
seed – Seed for shuffling the tasks, defaults to 0.
directory – The directory to download the dataset to, defaults to
capymoa.datasets.get_download_dir()
.auto_download – Should the dataset be automatically downloaded if it does not exist, defaults to True.
train_transform – A transform to apply to the training dataset, defaults to
default_train_transform
.test_transform – A transform to apply to the test dataset, defaults to
default_test_transform
.normalize_features – Should the features be normalized. This normalization step is after all other transformations.
- default_test_transform: Callable[[Any], Tensor] = ToTensor()[source]#
The default transform to apply to the dataset.
- default_train_transform: Callable[[Any], Tensor] = ToTensor()[source]#
The default transform to apply to the dataset.
- train_streams: Sequence[Stream[LabeledInstance]]#
A sequence of streams containing each task for training.
- test_streams: Sequence[Stream[LabeledInstance]]#
A sequence of streams containing each task for testing.
- task_schedule: Sequence[Set[int]]#
A sequence of sets containing the classes for each task.
In online continual learning your learner may not have access to this attribute. It is provided for evaluation and debugging.