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

Logging of distortion #1

Open
w-garcia opened this issue May 28, 2020 · 1 comment
Open

Logging of distortion #1

w-garcia opened this issue May 28, 2020 · 1 comment

Comments

@w-garcia
Copy link

Hello,

I am working through your implementation of the OPT attack, and had a question about calculation of distortion. It is logged as only g_theta here: https://github.com/cmhcbb/attackbox/blob/master/attack/OPT_attack.py#L69

However if I understand correctly, the right way to log distortion would be as LA.norm(g_theta * best_theta), since the final adversarial sample is x0 + g_theta*best_theta. It is printed that way here: https://github.com/cmhcbb/attackbox/blob/master/attack/OPT_attack.py#L99

Could this be clarified by the authors?

Thanks

@cmhcbb
Copy link
Owner

cmhcbb commented May 30, 2020

Hi,

self.log[0][0], self.log[0][1] = g_theta, query_count

This line is pointing to the first iteration of log, i.e. the distortion after finding the initial points by adding random distortion.
The log records all iteration's distortion and its # of quires until the algorithm stops, so you could think it is a matrix per example as shown in
self.log[i+1:,0] = g_theta
.

Also, the best_theta is always a norm-1 vector so we don't need to calculate the norm again.

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