SplitFashionMNIST#

class capymoa.datasets.ocl.SplitFashionMNIST[source]#

Bases: _BuiltInCIScenario

Split Fashion MNIST dataset for online class incremental learning.

References:

  1. Xiao, H., Rasul, K., & Vollgraf, R. (2017, August 28). Fashion-MNIST: a Novel Image Dataset for Benchmarking Machine Learning Algorithms.

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.286]#

The mean 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,
)[source]#

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.

std: Sequence[float] = [0.353]#

The standard deviation of the features in the dataset used for normalization.

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.

schema: Schema#

A schema describing the format of the data.