torch_concepts.data.datasets.mnist.ColorMNISTDataset

class ColorMNISTDataset(root: str, train: bool = False, transform=None, target_transform=None, download: bool = False, random: bool = True)[source]

The color MNIST dataset is a modified version of the MNIST dataset where each digit is colored either red or green. The concept labels are the digit and the color of the digit. The task is to predict whether the digit is even or odd.

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.

random

Whether to colorize the digits randomly. Default is True.

__init__(root: str, train: bool = False, transform=None, target_transform=None, download: bool = False, random: bool = True)[source]

Methods

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

download()

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

extra_repr()

Attributes

class_to_idx

classes

mirrors

processed_folder

raw_folder

resources

test_data

test_file

test_labels

train_data

train_labels

training_file