Open liushunyu opened 4 years ago
I think we have to set requires_grad = True to calculate the gradient of loss for the input image.
I think if you set requires_grad = True, you will back propagation gradient twice, because the adv image can also be back propagation to the network which generate it.
When I debug the
PGDtraining
, I find that requires_grad of adversarial data is true.Is that right? The input image may be not allowed to require grad.
https://github.com/DSE-MSU/DeepRobust/blob/9ba3751f33f87d0eda281497ce84aa99fe1f2206/deeprobust/image/defense/pgdtraining.py#L143
The
requires_grad
ofdata_adv
is true.