s-huu / TurningWeaknessIntoStrength

Official implementation for paper: A New Defense Against Adversarial Images: Turning a Weakness into a Strength
37 stars 10 forks source link

Optimizer may not be necessary in functions "targeted_detection" and "untargeted_detection" ? #6

Closed ywu36 closed 4 years ago

ywu36 commented 4 years ago

Dear author,

In functions "targeted_detection" and "untargeted_detection", a SGD optimizer is initialized at the very beginning, but it seems that no "optimizer_s.step()" is run inside of the functions. May I know the reason why we need the "optimizer_s"? It seems that "loss.backward()" and "x_var.grad.data" can do the job without the "optimizer_s". Thanks.

Best regards, YH

s-huu commented 4 years ago

Hi.

Yeah I agree with you that the optimizer here is not necessary. Thanks for pointing that out. We will make the fix!