cleverhans-lab / cleverhans

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

[TF2] TF2 implementation of FGM has the loss function hard coded #1167

Closed Joool closed 3 years ago

Joool commented 4 years ago

Describe the bug In contrast to the tf 1 version: https://github.com/tensorflow/cleverhans/blob/0bea6b83bb0c55e0843d95f49bf234b96c0bacb1/cleverhans/attacks/fast_gradient_method.py#L65-L75

The implementation of FGM in TF 2 has the loss function fixed in the source code: https://github.com/tensorflow/cleverhans/blob/0bea6b83bb0c55e0843d95f49bf234b96c0bacb1/cleverhans/future/tf2/attacks/fast_gradient_method.py#L76-L78

Thus experimenting with differnt loss functions/configurations requires you to fork the library.

madarax64 commented 3 years ago

Hello @Joool , This looks to be fixed in the current release?

Joool commented 3 years ago

Hi @madarax64, Yes this is fixed in the current version, I'm closing this and the related pull request.