Worst-case attribution distance when the input is randomly perturbed within a small radius. High values indicate brittle explanations sensitive to adversarial perturbations. ↓ better.
sensitivity_max
sensitivity_max(
explainer: Explainer | Attribution,
inputs: TensorOrTupleOfTensorsGeneric,
perturb_func: Callable = default_perturb_func,
perturb_radius: float = 0.02,
n_perturb_samples: int = 10,
norm_ord: str = "fro",
max_examples_per_batch: int | None = None,
multi_target: bool = False,
**kwargs: Any,
) -> Tensor | list[Tensor]
Maximum sensitivity — worst-case attribution distance under input perturbations. ↓ better.
Wraps sensitivity_max_and_avg and returns only the max component.
See sensitivity_max_and_avg for full argument documentation.
Source code in torchxai/metrics/robustness/sensitivity.py
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 | |