torch_concepts.data.datasets.mnist.MNISTAddition¶
- class MNISTAddition(root, train, target_transform=None, download=True)[source]¶
The MNIST addition dataset is a modified version of the MNIST dataset where each image is a concatenation of two MNIST images and the target label is the sum of the two digits. The concept label is a one-hot encoding of the two digits.
- 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.
Methods
__init__(root, train[, target_transform, ...])download()Download the MNIST data if it doesn't exist already.
extra_repr()Attributes
class_to_idxclassesmirrorsprocessed_folderraw_folderresourcestest_datatest_filetest_labelstrain_datatrain_labelstraining_file