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

Custom Attacks #85

Open
santosh-b opened this issue Nov 8, 2020 · 1 comment
Open

Custom Attacks #85

santosh-b opened this issue Nov 8, 2020 · 1 comment

Comments

@santosh-b
Copy link

Is there any way to train with my own custom attacks using the library, such as FGSM?

@andrewilyas
Copy link
Collaborator

Hi @santosh-b, yes there definitely is, this is a common use case. For FGSM specifically, you don't need to use any custom code, you can just use an l-infinity attack with 1 step, and set step size equal to epsilon. If you need something more complicated like a new kind of projection or something, you will just need to subclass the generic AttackerStep class (

class AttackerStep:
), and then feed in your subclass as the constraint instead of "2" or "inf." You can look at the UnconstrainedStep and RandomStep subclasses for examples of how to do this.

Hope this helps!

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