spencerwooo / torchattack

🛡 A curated list of adversarial attacks in PyTorch, with a focus on gradient-based transfer attacks
MIT License
38 stars 4 forks source link

DIFGSM fix input_diversity transform probability #15

Closed simone-dotolo closed 2 weeks ago

simone-dotolo commented 3 weeks ago

Diversity_prob = 1.0 doesn't apply transformation. Since torch.rand(1) is always less than 1.0, x is returned

Screenshot from 2024-11-11 16-10-43

spencerwooo commented 3 weeks ago

Thank you, good catch.