GraphSAGE icon indicating copy to clipboard operation
GraphSAGE copied to clipboard

[GraphSAGE] Positive and negative node pairs

Open Oolev opened this issue 5 years ago • 2 comments

Forgive my lack of knowledge, but I have a simple question regarding the provided demo for node representation learning with GraphSAGE and the use of an unsupervised sampler:

Given a large set of positive (+) node pairs (generated from random walks performed on the graph), and an equally large set of negative (-) pairs that are randomly selected from the graph

What do you mean by positive and negative node pairs? Could you point me to some useful resources to better understand this concept?

Oolev avatar Jul 05 '21 12:07 Oolev

Hello, I haven't used GraphSAGE but do follow the project. My understanding, based on the published papers, is as follows. Consider a node A that you are preparing the training samples for. Then a positive pair (A, B) is a pair where B is actually similar to A in some semantic sense: E.g. it is within n-steps from A, it shares some structural similarities with A (eg struct2vec). While a negative pair (A, C) is a pair where C is not similar to A, e.g. you randomly pick from the sub-graph that is over n steps removed from A.

The above approach was first used in training word2vec models (building embeddings for words.)

Hope the above helps.

a-little-srdjan avatar Jul 08 '21 02:07 a-little-srdjan

Hello, I haven't used GraphSAGE but do follow the project. My understanding, based on the published papers, is as follows. Consider a node A that you are preparing the training samples for. Then a positive pair (A, B) is a pair where B is actually similar to A in some semantic sense: E.g. it is within n-steps from A, it shares some structural similarities with A (eg struct2vec). While a negative pair (A, C) is a pair where C is not similar to A, e.g. you randomly pick from the sub-graph that is over n steps removed from A.

The above approach was first used in training word2vec models (building embeddings for words.)

Hope the above helps.

Thanks a lot! Much appreciated. It's clear now.

Oolev avatar Jul 08 '21 10:07 Oolev