Skip to content

Commit

Permalink
Fix node classification loss
Browse files Browse the repository at this point in the history
  • Loading branch information
cenyk1230 committed Aug 4, 2020
1 parent 6e33d80 commit c876d9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cogdl/tasks/node_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def _test_step(self, split="val"):
mask = self.data.val_mask
else:
mask = self.data.test_mask
loss = F.nll_loss(logits[mask], self.data.y[mask])
loss = F.nll_loss(logits[mask], self.data.y[mask]).item()

pred = logits[mask].max(1)[1]
acc = pred.eq(self.data.y[mask]).sum().item() / mask.sum().item()
Expand Down

0 comments on commit c876d9e

Please sign in to comment.