DSE-MSU / DeepRobust

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

Mistake in GGCL_D #31

Closed marblet closed 4 years ago

marblet commented 4 years ago

Thank you for developing this library! I guess GGCL, which is a module for RGCN, has a mistake in the return variables of forward function. In lines 69 - 72, graph/defense/rgcn.py, codes are written as:

Att = torch.exp(-gamma * sigma)
mean_out = adj_norm1 @ (miu * Att)
sigma_out = adj_norm2 @ (sigma * Att * Att)
return mean_out, sigma

Currently forward returns sigma. But I think forward should return sigma_out, i.e. sigma applied the attention Att

Att = torch.exp(-gamma * sigma)
mean_out = adj_norm1 @ (miu * Att)
sigma_out = adj_norm2 @ (sigma * Att * Att)
return mean_out, sigma_out

If so, I will make a PR for this. Thank you.

ChandlerBang commented 4 years ago

Yes, you are right. Please make a PR and I'll merge it. Thanks for pointing it out.