Why the value of epsilon in step 4 in Algorithm 2 needs to be multiplied by 2?
Hi, I'm very interested in your paper. I have a question. Why the value of epsilon in step 4 in Algorithm 2 needs to be multiplied by 2?
Hi, Thanks for the interest in our paper. 2*eps is there to ensure that we can go from one corner of the Linf cube to the other, i.e. change a value of -eps to eps and from eps to -eps.
Thanks a lot for your answer. I have another question about 2eps in step 4 in Algorithm 2.
Should [-eps,eps] be written as [-2eps,2*eps] in the corresponding place in the code?
https://github.com/max-andr/square-attack/blob/ea95eebb5aca62ec790a927b5aa985ba4e87245c/attack.py#L236
written as
deltas[i_img, :, center_h:center_h+s, center_w:center_w+s] = np.random.choice([-2*eps, 2*eps], size=[c, 1, 1])
Sorry, I somehow missed your reply.
[-eps, eps] in line 236 is correct since here we modify the values of the deltas directly instead of adding a perturbation to an existing delta (as in our algorithm description in the paper).