ryderling / DEEPSEC

DEEPSEC: A Uniform Platform for Security Analysis of Deep Learning Model
MIT License
205 stars 71 forks source link

What's the difference between UMIFGSM and TMIFGSM #16

Open XiaodanLi001 opened 5 years ago

XiaodanLi001 commented 5 years ago

I just find line 67 is the only difference between them. But in each iteration, the grad.data will be updated automatically. Why did you "zeros" grad.data by hand?

ryderling commented 5 years ago

Thanks. The difference between UMIFGSM and TMIFGSM is equal to the difference between un-target attack and target. More detail can be found in Equation 6-7 and Equation 11-12 of Yinpeng Dong et al. Boosting Adversarial Attacks with Momentum. In our implementation, there are totally different, and you can find these difference in "the loss calculation" and "update x in each iteration". For the zero_(), it is a dummy operation since the var_samples is built newly in each iteration. Hope answered your questions.