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

[QUESTION] Binary search for Carlini-Wagner #167

Closed
Adversarian opened this issue Nov 12, 2023 · 4 comments
Closed

[QUESTION] Binary search for Carlini-Wagner #167

Adversarian opened this issue Nov 12, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@Adversarian
Copy link

Adversarian commented Nov 12, 2023

❔ Any questions

Hi! First I would like to thank you for your tremendous work on this project. I had a question regarding the CW attack.

In the README page of the project a section under "Getting Started" mentions "Binary search for CW" whereas the documentation states that binary search over c was not implemented because it is time consuming. This has left me confused because if there is a way to perform binary search over c using this library, I would like to know so I can stop using multiple libraries and if not, then what is the subsection under "Getting Started" referring to?

@Adversarian Adversarian added the enhancement New feature or request label Nov 12, 2023
@rikonaka
Copy link
Contributor

rikonaka commented Nov 12, 2023

Hi @Adversarian , I don’t quite understand something about your expression in I would like to know so I can stop using multiple libraries and if not.

According to the README page, if you want to perform a binary search, you can try the following code.

atk1 = torchattacks.CW(model, c=0.1, steps=1000, lr=0.01)
atk2 = torchattacks.CW(model, c=1, steps=1000, lr=0.01)
atk = torchattacks.MultiAttack([atk1, atk2])

But this code can't seem to stop early.

Well, I tested this code (I am not the maintainer or contributor of this code), and I found that this code does not seem to be able to perform the binary search function it claims. This code only uses one of the attacks to obtain the image, not a binary search. I will submit a version of CW's binary search as soon as possible

test

@Adversarian
Copy link
Author

Adversarian commented Nov 12, 2023

Hi @rikonaka, thank you for your prompt response.

Regarding your confusion, I am currently using foolbox which includes a CW implementation with binary search and torchattacks for everything else and I was hoping to migrating to torchattacks for everything if possible which makes my code very cleaner and easier to understand, maintain and debug.

I understand that a binary search with CW is not very difficult to implement but I simply don't have to time at the moment to submit my own PR so I would immensely appreciate it if you could make it happen.

@rikonaka
Copy link
Contributor

rikonaka commented Nov 12, 2023

Hi @rikonaka, thank you for your prompt response.

Regarding your confusion, I am currently using foolbox which includes a CW implementation with binary search and torchattacks for everything else and I was hoping to migrating to torchattacks for everything if possible which makes my code very cleaner and easier to understand, maintain and debug.

I understand that a binary search with CW is not very difficult to implement but I simply don't have to time at the moment to submit my own PR so I would immensely appreciate it if you could make it happen.

Good news 😉, I just spent two hours implementing the CW with binary search, and soon you can use it in torchattacks. It has now been submitted and is ready to be merged into the mainline.

@Adversarian
Copy link
Author

I am very much obliged. Thank you so much. I'm gonna optimistically close this now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants