You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
with normalise_by_negative being defined in normalise_func.py as
def normalise_by_negative(a: np.ndarray) -> np.ndarray:
"""Normalise relevance given a relevance matrix (r) [-1, 1]."""
if a.min() >= 0.0:
return a / a.max()
if a.max() <= 0.0:
return -a / a.min()
return (a > 0.0) * a / a.max() - (a < 0.0) * a / a.min()
I think this type of normalisation (as default) may lead to some unexpected/unintended behavior for many metrics (RegionPerturbation, for instance), since it normalises positive and negative parts of an attribution map by different values, and then changes the sign of the negative parts (thus basically taking the abs()). I believe this changes not only the ordering of attribution values (as abs() would), but also their relative magnitudes.
For this reason, a better default may be either self.normalise = self.kwargs.get("normalise", False) or self.normalise_func = self.kwargs.get("normalise_func", normalise_by_max)` ?
The text was updated successfully, but these errors were encountered:
For a lot of quantification metrics (only checked the faithfulness_metrics.py for this) the default seems to be
with
normalise_by_negative
being defined in normalise_func.py asI think this type of normalisation (as default) may lead to some unexpected/unintended behavior for many metrics (RegionPerturbation, for instance), since it normalises positive and negative parts of an attribution map by different values, and then changes the sign of the negative parts (thus basically taking the abs()). I believe this changes not only the ordering of attribution values (as abs() would), but also their relative magnitudes.
For this reason, a better default may be either
self.normalise = self.kwargs.get("normalise", False)
orself.normalise_func
= self.kwargs.get("normalise_func", normalise_by_max)` ?The text was updated successfully, but these errors were encountered: