peal.data.custom_datasets.MnistDataset

class peal.data.custom_datasets.MnistDataset[source]

Bases: Image2ClassDataset

Plain MNIST in the ImageFolder layout, without any confounder.

On first use the torchvision MNIST train and test splits are downloaded to <dataset_path>_train_raw and <dataset_path>_val_raw and written out as PNGs under <dataset_path>/imgs/<digit>/<running index>.png, so that Image2ClassDataset can take over and split them by config.split.

Parameters:
  • config (DataConfig) – Uses dataset_path; the remaining fields are interpreted by Image2ClassDataset.

  • **kwargs – Forwarded to Image2ClassDataset (mode, transform, …).

Methods

Attributes

__init__(config, **kwargs)[source]

Write the MNIST PNG tree if config.dataset_path does not exist yet.

Parameters:

config (DataConfig)