Skip to content

Commit

Permalink
Update sparsefool.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry24k committed Oct 3, 2022
1 parent 7b95a71 commit 6235643
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions torchattacks/attacks/sparsefool.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class SparseFool(Attack):
Arguments:
model (nn.Module): model to attack.
steps (int): number of steps. (Default: 20)
steps (int): number of steps. (Default: 10)
lam (float): parameter for scaling DeepFool noise. (Default: 3)
overshoot (float): parameter for enhancing the noise. (Default: 0.02)
Expand All @@ -27,11 +27,11 @@ class SparseFool(Attack):
- output: :math:`(N, C, H, W)`.
Examples::
>>> attack = torchattacks.SparseFool(model, steps=20, lam=3, overshoot=0.02)
>>> attack = torchattacks.SparseFool(model, steps=10, lam=3, overshoot=0.02)
>>> adv_images = attack(images, labels)
"""
def __init__(self, model, steps=20, lam=3, overshoot=0.02):
def __init__(self, model, steps=10, lam=3, overshoot=0.02):
super().__init__("SparseFool", model)
self.steps = steps
self.lam = lam
Expand Down

0 comments on commit 6235643

Please sign in to comment.