cleverhans-lab / cleverhans

An adversarial example library for constructing attacks, building defenses, and benchmarking both
MIT License
6.15k stars 1.39k forks source link

Torch implemantation of the fast gradient method #1211

Open amirhagai opened 3 years ago

amirhagai commented 3 years ago

Hi! Thanks for that great library!

It seems like the torch implementation assumes that the given model had been trained with cross-entropy loss, line 80 at torch/attacks/fast_gradient_method.py.

In the TF version(as in the paper) one can specify the loss function, line 46 at tf2/attacks/fast_gradient_method.py and in the Function signature.

Thanks!

tejuafonja commented 3 years ago

Hi Amir,

Thanks for pointing this out. Indeed, it would be much better if the loss function is included in the function signature as done in the TensorFlow implementation. Would you like to send a PR addressing this?

amirhagai commented 3 years ago

Sure :)

Kkuntal990 commented 3 years ago

Hey, @tejuafonja is this issue still open? I would like to work if that's the case

tejuafonja commented 3 years ago

Hi @Kkuntal990, yes it is. Please feel free to send a PR anytime : )

gkysaad commented 2 years ago

Hello, I've implemented a fix for this here: https://github.com/cleverhans-lab/cleverhans/pull/1222