Skip to content

Commit

Permalink
Merge pull request #67 from samuelemarro/master
Browse files Browse the repository at this point in the history
Fixed superclass constructor call in BasicIterativeAttack.
  • Loading branch information
gwding authored Mar 1, 2020
2 parents 14a9998 + 51dcaeb commit e191ee3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions advertorch/attacks/iterative_projected_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,10 @@ def __init__(self, predict, loss_fn=None, eps=0.1, nb_iter=10,
eps_iter=0.05, clip_min=0., clip_max=1., targeted=False):
ord = 2
rand_init = False
l1_sparsity = None
super(L2BasicIterativeAttack, self).__init__(
predict, loss_fn, eps, nb_iter, eps_iter, rand_init,
clip_min, clip_max, ord, targeted)
clip_min, clip_max, ord, l1_sparsity, targeted)


class LinfBasicIterativeAttack(PGDAttack):
Expand All @@ -344,9 +345,10 @@ def __init__(self, predict, loss_fn=None, eps=0.1, nb_iter=10,
eps_iter=0.05, clip_min=0., clip_max=1., targeted=False):
ord = np.inf
rand_init = False
l1_sparsity = None
super(LinfBasicIterativeAttack, self).__init__(
predict, loss_fn, eps, nb_iter, eps_iter, rand_init,
clip_min, clip_max, ord, targeted)
clip_min, clip_max, ord, l1_sparsity, targeted)


class MomentumIterativeAttack(Attack, LabelMixin):
Expand Down

0 comments on commit e191ee3

Please sign in to comment.