Skip to content

Commit

Permalink
Merge pull request #15 from simone-dotolo:main
Browse files Browse the repository at this point in the history
DIFGSM fix input_diversity transform probability
  • Loading branch information
spencerwooo authored Nov 14, 2024
2 parents 5ab4ce9 + c1c6e28 commit a49ae05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/torchattack/difgsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def input_diversity(
The diversified batch of images. Shape: (N, C, H, W).
"""

if torch.rand(1) < diversity_prob:
if torch.rand(1) > diversity_prob:
return x

img_size = x.shape[-1]
Expand Down

0 comments on commit a49ae05

Please sign in to comment.