DongkiKim95/D-SLA

Confuse about the "answer" in GD_loss

Closed this issue · 2 comments

Nice work! I noticed that in your GNNWrapper you have the GD_loss to learn to categorize original and perturbed graph. However, the ground truth answers you have for the cross entropy are all zero. I thought it should be something like [1, 0, 0, 0, 1, 0, 0, ...] (assume num_candidate=4) since the first candidate is the original graph. Am I missing something here? Thanks!

Hi, thanks for your interest in our work!

The ground truth answer of F.cross_entropy could be one-hot or indices.
It would be helpful to check this URL: https://pytorch.org/docs/stable/generated/torch.nn.functional.cross_entropy.html#torch.nn.functional.cross_entropy

So, in our codes, the answers are the indices, and they should be all zeros.

Thank you for the explanation!