Predict two relations at the same time


Can I use a R-GCN like in this case (5.3 Link Prediction — DGL 0.6.1 documentation) to predict more than one type of link from a heterograph at the same time?

Also, If i am using batched graph, if a split it into train and test using the number of nodes as reference, i am using the first n grpahs for training and the last one for testing, right? If not, is there another way to split the batched graph and use some graph for training and some for testing?


Yes. You can compute the positive scores, negative scores, and losses for every edge type.

If your task requires you to train on some multiple heterogeneous graphs and then predict on a brand new heterogeneous graph, then yes.

1 Like

Thank you so much.

About the first issue: is it possible to create a unique negative graph for two type of links, instead of one for each other?

I think EdgeDataLoader already does that if you feed in edges of multiple types as a dict to iterate, although that will only happen when a minibatch contains multiple edge types.

1 Like