rakutentech / stAdv

Spatially Transformed Adversarial Examples with TensorFlow
MIT License
72 stars 18 forks source link

Incorrect implementation of adv_loss() #2

Closed anianruoss closed 6 years ago

anianruoss commented 6 years ago

In my opinion, line 115 in losses.py should be:

return tf.maximum(L_adv_1 - L_adv_2, kappa, name='L_adv')

instead of:

return tf.maximum(L_adv_1 - L_adv_2, - kappa, name='L_adv')

according to eq. (3) in Xiao et al.

Am I missing something?

berangerd commented 6 years ago

That's a difference in notation between Eq. (3) of Xiao et al. and Carlini & Wagner (see bottom of p. 9 in https://arxiv.org/pdf/1608.04644.pdf). Xiao et al. assume a negative kappa (well in practice they only consider kappa = 0) while Carlini & Wagner assume a positive one. As the documentation of the function adv_loss primarily refers to the Carlini & Wagner paper I think it is sufficiently clear.

anianruoss commented 6 years ago

Thank you for clarifying!