Examples/pinsage What is the pos_graph/neg_graph?

As I understood pos/neg graphs are graphs which nodes are items, am i right? Also I can’t understand what is the sense of negative graph, how does it improve training? Thanks

The basic idea is that we want to maximize the inner product of positive examples, i.e., the embedding of the query item and the corresponding related item. At the same time we want to ensure that the inner product of negative examples—i.e., the inner product between the embedding of the query item and an unrelated item—is smaller than that of the positive sample by some pre-defined margin.

DGL prefers to create a separate negative graph having just these negative examples, as you can calculate both pos and neg scores at a time by just passing the computed embeddings to both these graphs.
You may also have noticed this design in dgl link prediction tasks too

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.