peal.data.dataset_generators¶
Generators for PEAL’s synthetic and confounded benchmark datasets.
Each class writes a dataset directory in the layout PEAL’s dataset classes
read (imgs/, optional masks/ with segmentation hints, and a
data.csv or .json label file with one column per attribute) into
data_config.dataset_path or a datasets/<name> folder. The generators
plant a known confounder next to the true feature (copyright tags, colour
shifts, staining intensity, square colour/position, specific numbers, nodule
roundness, …) so that adaptors can be evaluated against ground truth.
Functions
Render one 64x64 "square" image from its generative factors. |
Classes
Generates a sequence dataset with a confounder tnecklace is a symbolic attribute. |
|
Generates a tabular dataset with a confounder tnecklace is a symbolic attribute. |
|
Generates dataset based on a unit circle of radius r |
|
Stamp a synthetic confounder onto an existing image dataset (e.g. CelebA). |
|
Generates a PEAL-compatible FunnyNodules dataset. |
|
Two-digit MNIST subset with a red background as confounder. |
|
Generates a dataset of 128x128 synthetic images with a 2×4 grid of numbers. |
|
Variant of OnlySparseNumbersDatasetGenerator where number frequencies follow Zipf's law: P(n) ∝ 1/(n+1)^s with s=1 (configurable via data_config.zipf_s). |
|
Generates a dataset of images with a 2x4 grid of 4-digit numbers. |
|
Variant of SparseNumbersDatasetGenerator where sparse number frequencies follow Zipf's law: P(n) ∝ 1/(n+1)^s with s=1. |
|
Synthetic 64x64 "square" dataset with four independent binary factors. |
|
Build a histology dataset whose confounder is the hematoxylin staining. |