-
Notifications
You must be signed in to change notification settings - Fork 0
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
Speedup adversarial training with a simple perturber #89
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments.
This comment was marked as resolved.
This comment was marked as resolved.
EntiretyPerturber
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
What does this PR do?
This PR makes the example adversarial training task
python -m mart experiment=CIFAR10_CNN_Adv
1.92x faster (400 seconds over 769 seconds).Adversarial training is slow because MART tries to keep track of each input example in one NCHW batch, resulting in running
gradient_modifier
andprojector
and enforcingthreat_model
separately.This is not necessary for the simple FGSM attack in adversarial training.
Replacing with a simple Perturber that represents perturbations in the NCHW format enables batching
gradient_modifier
,projector
andthreat_model
efficiently.Type of change
Please check all relevant options.
Testing
Please describe the tests that you ran to verify your changes. Consider listing any relevant details of your test configuration.
Before submitting
pre-commit run -a
command without errorsDid you have fun?
Make sure you had fun coding 🙃