sunfanyunn / InfoGraph

Official code for "InfoGraph: Unsupervised and Semi-supervised Graph-Level Representation Learning via Mutual Information Maximization" (ICLR 2020, spotlight)
https://openreview.net/forum?id=r1lfF2NYvH
311 stars 45 forks source link

Question about sum() being called on the errors #10

Open melnimr opened 2 years ago

melnimr commented 2 years ago

When I look at :

 error += (model(data) * std - data.y * std).abs().sum().item()  # MAE

I am curious what the .sum is doing here? Aren't these just the errors for each entry in the batch, why do you need to sum them?