Skip to content

Commit

Permalink
Merge branch 'abigailgold-dev_1.17.0_no_labels_mi' into dev_1.17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
beat-buesser committed Dec 19, 2023
2 parents cc03386 + 752e494 commit a281f62
Show file tree
Hide file tree
Showing 4 changed files with 370 additions and 159 deletions.
6 changes: 3 additions & 3 deletions art/attacks/evasion/composite_adversarial_attack.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class CompositeAdversarialAttackPyTorch(EvasionAttack):
and uses the iterative gradient sign method to optimize the perturbations in semantic space and Lp-ball (see
`FastGradientMethod` and `BasicIterativeMethod`).
| Note that this attack is intended for only PyTorch image classifiers with RGB images in the range [0, 1] as inputs.
| Note that this attack is intended for only PyTorch image classifiers with RGB images in the range [0, 1] as inputs
| Paper link: https://arxiv.org/abs/2202.04235
"""
Expand Down Expand Up @@ -222,7 +222,7 @@ def _check_params(self) -> None:
f"within {_epsilons_range[i][2]} of type tuple."
)

if not (_epsilons_range[i][1][0] <= self.epsilons[i][0] <= self.epsilons[i][1] <= _epsilons_range[i][1][1]):
if not _epsilons_range[i][1][0] <= self.epsilons[i][0] <= self.epsilons[i][1] <= _epsilons_range[i][1][1]:
logger.info(
"The argument `%s` must be an interval within %s of type tuple.",
_epsilons_range[i][0],
Expand Down Expand Up @@ -653,7 +653,7 @@ def caa_attack(self, images: "torch.Tensor", labels: "torch.Tensor") -> "torch.T

for tdx in range(self.seq_num):
idx = self.curr_seq[tdx]
adv_img, adv_val_updated = self.attack_dict[idx](adv_img, adv_val[idx], labels)
adv_img, adv_val_updated = self.attack_dict[idx](adv_img, adv_val[idx], labels) # type: ignore
if idx != self.linf_idx:
adv_val[idx] = adv_val_updated

Expand Down
Loading

0 comments on commit a281f62

Please sign in to comment.