peal.teachers.spray_teacher¶
SpRAy teacher: find confounded samples by clustering LRP attributions.
Spectral Relevance Analysis (SpRAy) computes layer-wise relevance attributions
of a classifier over the dataset, clusters them per class with corelay’s
spectral clustering pipeline, and serves the result in a ViReLay web GUI. A
human selects the clusters that show a confounding (Clever-Hans) feature and
exports them; the teacher turns those selections into per-sample group labels
that downstream adaptors (e.g. ClArC or GroupDRO) can train against. All
intermediate HDF5 databases are written under base_dir.
Functions
Write a batch of attributions, predictions, labels and splits at |
|
Write a batch of inputs, labels and filenames at row |
|
Create an HDF5 attribution database in the ViReLay layout. |
|
Create an HDF5 file with resizable |
|
Truncate the attribution database's datasets to |
|
Truncate the input database's datasets to |
Classes
corelay processor flattening each sample to a vector. |
|
Module returning |
|
corelay processor dividing each sample by its total sum. |
|
Teacher that derives confounder group labels from a SpRAy analysis. |
|
Config for the |
|
corelay processor summing attributions over the channel axis. |