Skip to content

Commit

Permalink
Merge pull request #289 from understandable-machine-intelligence-lab/…
Browse files Browse the repository at this point in the history
…bugfix-max-sens

Fixed issue in max_sensitivity.py
  • Loading branch information
annahedstroem authored Aug 8, 2023
2 parents 3233228 + 748b24b commit 5fcce79
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion quantus/metrics/robustness/avg_sensitivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def evaluate_batch(
b=a_perturbed[instance_id].flatten(),
)
numerator = self.norm_numerator(a=sensitivities)
denominator = self.norm_denominator(a=x_batch[instance_id].flatten())
denominator = self.norm_denominator(a=a_batch[instance_id].flatten())
sensitivities_norm = numerator / denominator
similarities[instance_id, step_id] = sensitivities_norm
mean_func = np.mean if self.return_nan_when_prediction_changes else np.nanmean
Expand Down
2 changes: 1 addition & 1 deletion quantus/metrics/robustness/max_sensitivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def evaluate_batch(
b=a_perturbed[instance_id].flatten(),
)
numerator = self.norm_numerator(a=sensitivities)
denominator = self.norm_denominator(a=x_batch[instance_id].flatten())
denominator = self.norm_denominator(a=a_batch[instance_id].flatten())
sensitivities_norm = numerator / denominator
similarities[instance_id, step_id] = sensitivities_norm

Expand Down

0 comments on commit 5fcce79

Please sign in to comment.