General API Reference
This page contains the API reference for the attribench package.
Computations and Metrics
Computations and metrics are divided into two API groups: a functional API and an object-oriented API. The functional API is the simplest to use, but does not support multi-GPU computations. If you want to run a large-scale benchmarking experiment on multiple GPUs, you should use the object-oriented API.
Results
|
Abstract class to represent results of distributed metrics. |
Abstract class to represent grouped results of distributed metrics. |
|
Represents results from running the Deletion metric. |
|
This class serves as a simple wrapper class for Insertion results. |
|
Represents results from running the ImpactCoverage metric. |
|
Represents results from running the Infidelity metric. |
|
Represents results from running the Max-Sensitivity metric. |
|
Represents results from running the MinimalSubset metric. |
|
Represents results from running the Sensitivity-N metric. |
Data
|
Wraps a dataset to return the index of the sample as well. |
|
Represents a dataset containing attributions for a set of samples and attribution methods. |
Dataset stored in a HDF5 file. |
Masking
Base class for all maskers. |
|
Abstract base class for all image maskers. |
|
Image masker that masks pixels or features by replacing them with a blurred version of the image. |
|
Image masker that masks pixels or features by replacing them with a given constant value. |
|
Image masker that masks images with normally distributed random noise, with a given standard deviation. |
|
Image masker that masks pixels or features by replacing them with the average value in the corresponding image. |
|
|
|
Plot
|
Abstract base class for all plots. |
Summary plot for Wilcoxon tests. |
|
Heatmap showing Spearman correlations between metrics. |
|
Heatmap showing Spearman correlations between methods. |
|
Line plot of the median values of a given metric vs the number of samples. |
|
Bar plot of Krippendorff's alpha for each metric. |
|
Clustermap of the median values of the metrics and methods. |
|
Bar plot of the MAD (Median Absolute Deviation) ratio for each metric. |
|
Alternative to WilcoxonSummaryPlot. |
Other
Basic interface for a callable that returns a model. |
|
|
Basic implementation of a |
|
This class accepts a config dictionary for attribution methods in its constructor, and will return a dictionary of ready-to-use AttributionMethod objects when called with a model (nn.Module) as argument. |
|
Wrapper class for attribution methods. |