Skip to content

Commit a281f62

Browse files
committed
Merge branch 'abigailgold-dev_1.17.0_no_labels_mi' into dev_1.17.0
2 parents cc03386 + 752e494 commit a281f62

File tree

4 files changed

+370
-159
lines changed

4 files changed

+370
-159
lines changed

art/attacks/evasion/composite_adversarial_attack.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class CompositeAdversarialAttackPyTorch(EvasionAttack):
5353
and uses the iterative gradient sign method to optimize the perturbations in semantic space and Lp-ball (see
5454
`FastGradientMethod` and `BasicIterativeMethod`).
5555
56-
| Note that this attack is intended for only PyTorch image classifiers with RGB images in the range [0, 1] as inputs.
56+
| Note that this attack is intended for only PyTorch image classifiers with RGB images in the range [0, 1] as inputs
5757
5858
| Paper link: https://arxiv.org/abs/2202.04235
5959
"""
@@ -222,7 +222,7 @@ def _check_params(self) -> None:
222222
f"within {_epsilons_range[i][2]} of type tuple."
223223
)
224224

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

654654
for tdx in range(self.seq_num):
655655
idx = self.curr_seq[tdx]
656-
adv_img, adv_val_updated = self.attack_dict[idx](adv_img, adv_val[idx], labels)
656+
adv_img, adv_val_updated = self.attack_dict[idx](adv_img, adv_val[idx], labels) # type: ignore
657657
if idx != self.linf_idx:
658658
adv_val[idx] = adv_val_updated
659659

0 commit comments

Comments
 (0)