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 (sequence of tuple) – Indexable sequence of (attribution, prediction, label) triples; attribution is a tensor, the other two scalars. Its length is the number of samples and dataloader[0][0].shape the attribution shape.

  • attribution_database_file_path (str) – Path of the HDF5 file to create.

  • num_classes (int) – Width of the prediction dataset.