peal.data.interfaces

Base dataset class and the pydantic DataConfig shared by all PEAL data.

PealDataset extends torch.utils.data.Dataset with the hooks the rest of PEAL relies on: mapping samples between the dataset’s processed format and the “pytorch default” format generators work in, rendering original/counterfactual collages for teachers, and (optional) distance/variance/flip-rate metrics used by explainer evaluation. DataConfig is the yaml-facing description of a dataset (shapes, splits, normalisation, confounder layout, augmentation) that dataset_factory and every generator/explainer consume.

Classes

DataConfig

Pydantic description of a dataset, loadable from yaml.

PealDataset

Base class of every dataset in PEAL.