-
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
Fix adversarial training #23
Comments
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To generate an adversarial example given a model and a clean example, gradient-based techniques generally move along the loss gradients of the clean example trying to maximise loss.
in my old adv-training implementation, I notice I generate a batch of adversarial examples by perturbing a batch of clean examples. My way tended to aggregate the cross-entropy loss of all the examples in the batch and used that loss for all the points, instead of each point's own CE loss to perturb it. No wonder pure AT did not work in my thesis, elementary error
The fix is manually perturbing each clean example in the batch on its own, computing and using CE loss for that point alone.
Not sure if my word salad here is comprehensible but hey
The text was updated successfully, but these errors were encountered: