From 51dcaebcc0332260fb2b35a00aa9c2e96f4ac103 Mon Sep 17 00:00:00 2001 From: Samuele Marro Date: Sun, 1 Mar 2020 21:08:00 +0100 Subject: [PATCH] Fixed superclass call in BasicIterativeAttack --- advertorch/attacks/iterative_projected_gradient.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/advertorch/attacks/iterative_projected_gradient.py b/advertorch/attacks/iterative_projected_gradient.py index 03b212d..6ea8ad6 100644 --- a/advertorch/attacks/iterative_projected_gradient.py +++ b/advertorch/attacks/iterative_projected_gradient.py @@ -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): @@ -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):