Measures the fraction of features assigned zero attribution that nonetheless change the model output when perturbed (axiomatic property: zero-attribution features should not matter). ↓ better.
non_sensitivity
non_sensitivity(
forward_func: Callable,
inputs: TensorOrTupleOfTensorsGeneric,
attributions: list[TensorOrTupleOfTensorsGeneric] | TensorOrTupleOfTensorsGeneric,
baselines: BaselineType = None,
feature_mask: TensorOrTupleOfTensorsGeneric | None = None,
additional_forward_args: Any = None,
target: ExplanationTarget | list[ExplanationTarget] = NoTarget(),
frozen_features: list[Tensor] | None = None,
perturb_func: Callable = default_fixed_baseline_perturb_func(),
n_perturbations_per_feature: int = 10,
max_features_processed_per_batch: int | None = None,
percentage_feature_removal_per_step: float = 0.0,
zero_attribution_threshold: float = 1e-05,
zero_variance_threshold: float = 1e-05,
use_percentage_attribution_threshold: bool = False,
return_ratio: bool = True,
show_progress: bool = True,
multi_target: bool = False,
) -> Tensor | list[Tensor]
Fraction of zero-attribution features that nonetheless cause a model output change. ↓ better.
Alias for the second return value of monotonicity_corr_and_non_sens. See that function for full
argument documentation.
Source code in torchxai/metrics/axiomatic/monotonicity_corr_and_non_sens.py
885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 | |