Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

L_1 norm is calculated incorrectly in the MIFGSM method #12

Closed
huitailangyz opened this issue Dec 12, 2020 · 1 comment
Closed

L_1 norm is calculated incorrectly in the MIFGSM method #12

huitailangyz opened this issue Dec 12, 2020 · 1 comment

Comments

@huitailangyz
Copy link

The L1 norm in MIFGSM now is calculated per batch, but actually is should be calculated per image.

grad_norm = torch.norm(grad, p=1)

The implementation now leads to different results when using different batch size.
For my evaluation (used my own trained model in CIFAR10), the difference of the accuracy between the batch size 1 vs 100 is about 1%.

@Harry24k
Copy link
Owner

Harry24k commented Dec 12, 2020

Hello!
Thanks for your correction 😄.
Please refer to v2.11.0.

@Harry24k Harry24k closed this as completed Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants