Skip to content

How the negative_sampling function is implemented? #3623

Answered by rusty1s
chunyuma asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, and thanks for your interest. You are right that negative_sampling might sample positive edges contained in the validation and test set. However, we are not allowed to acknowledge their existence during training to prevent any data leakage. Although this seems to be counter-intuitive at first glance, it is to be expected that such a noise in the learning signal is averaged out during optimization.

Related to your second issue: Yes, this is a trade-off regarding runtime efficiency and correctness. In general, we do not see a decrease in performance when sampling a positive edge as negative during training once in a while.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@chunyuma
Comment options

@colorlace
Comment options

Answer selected by chunyuma
# for free to join this conversation on GitHub. Already have an account? # to comment
Category
Q&A
Labels
None yet
3 participants