DSE-MSU / DeepRobust

A pytorch adversarial library for attack and defense methods on images and graphs
MIT License
994 stars 192 forks source link

Quick question regarding prognn #63

Closed zeyuyun1 closed 3 years ago

zeyuyun1 commented 3 years ago

https://github.com/DSE-MSU/DeepRobust/blob/067f1e1ea407e89df068eff65835392ea79b5b75/deeprobust/graph/defense/prognn.py#L181

What's the idea behind this line? Why would the nuclear loss be zeroed before taking the backpropagation step?

ChandlerBang commented 3 years ago

Hi, if you take a look at the conditional statements https://github.com/DSE-MSU/DeepRobust/blob/067f1e1ea407e89df068eff65835392ea79b5b75/deeprobust/graph/defense/prognn.py#L182-L185

you will find that the loss_nuclear is 0 only when args.beta==0(the coefficient controlling the contribution of low rank). Otherwise, loss_nuclear will be replaced by prox_operators.nuclear_norm.

zeyuyun1 commented 3 years ago

Thanks for the quick reply!