peal.teachers.virelay_teacher.create_attribution_dataset¶
- peal.teachers.virelay_teacher.create_attribution_dataset(dataloader, attribution_database_file_path, num_classes)[source]¶
Write a sequence of single attributions into a new attribution database.
- Parameters:
dataloader (
sequenceoftuple) – Indexable sequence of(attribution, prediction, label)triples;attributionis a tensor, the other two scalars. Its length is the number of samples anddataloader[0][0].shapethe attribution shape.attribution_database_file_path (
str) – Path of the HDF5 file to create.num_classes (
int) – Width of thepredictiondataset.