Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GraphSAGE] Positive and negative node pairs #165

Open
Oolev opened this issue Jul 5, 2021 · 2 comments
Open

[GraphSAGE] Positive and negative node pairs #165

Oolev opened this issue Jul 5, 2021 · 2 comments

Comments

@Oolev
Copy link

Oolev commented Jul 5, 2021

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?

@a-little-srdjan
Copy link

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.

@Oolev
Copy link
Author

Oolev commented Jul 8, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants