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

Make loss function a parameter in torch implementation #1222

Open gkysaad opened 2 years ago

gkysaad commented 2 years ago

Implemented fix to this issue: https://github.com/cleverhans-lab/cleverhans/issues/1211. The loss_fn used must only take 2 parameters (output and target).

kylematoba commented 2 years ago

This seems great. It'd help me if you could also make the same change in this call: https://github.com/cleverhans-lab/cleverhans/blob/master/cleverhans/torch/attacks/projected_gradient_descent.py#L123.