torch_concepts.data.datasets.mnist.MNISTEvenOdd

class MNISTEvenOdd(root, train, target_transform=None, download=True)[source]

The MNIST even-odd dataset is a modified version of the MNIST dataset where the task is to predict whether the digit is even or odd. The concept label is a one-hot encoding of the digit.

concept_names

The names of the concept labels.

task_names

The names of the task labels.

root

The root directory where the dataset is stored.

train

Whether to load the training or test split. Default is False.

transform

The transformations to apply to the images. Default is None.

target_transform

The transformations to apply to the target labels. Default is None.

download

Whether to download the dataset if it does not exist. Default is False.

__init__(root, train, target_transform=None, download=True)[source]

Methods

__init__(root, train[, target_transform, ...])

download()

Download the MNIST data if it doesn't exist already.

extra_repr()

Attributes

class_to_idx

classes

concept_names

input_dim

input_shape

mirrors

n_concepts

n_tasks

name

processed_folder

raw_folder

resources

task_names

test_data

test_file

test_labels

train_data

train_labels

training_file

transform