gasteigerjo / ppnp

PPNP & APPNP models from "Predict then Propagate: Graph Neural Networks meet Personalized PageRank" (ICLR 2019)
https://www.daml.in.tum.de/ppnp
MIT License
318 stars 53 forks source link

Running on a graph with missing labels #9

Closed jdcc closed 4 years ago

jdcc commented 4 years ago

Judging from this code and the fact that the labels need to be an array of ints (so no NaNs), it looks like this repo assumes a graph with a ground truth label for every node (and then hides some of those labels from training passes). I'm interested in running this on a graph for which I don't have ground truth for every node. So I have a couple questions:

  1. Is the above understanding correct?
  2. If so, before I really get into the code, any pointers on what I might need to change to make this work?

Thanks for all the work you've done making this open!

gasteigerjo commented 4 years ago

The code just expects a matrix that has the right shape. You could fill the missing labels with some placeholder, -1 for example. Then you just need to make sure to pass the right indices for the training set etc., so you don't encounter these placeholders (-1 would ensure that the model always fails loudly, since nll_loss expects a positive integer). The indices are generated here.

Happy coding!

jdcc commented 4 years ago

Ah, perfect! Thanks!