snap-stanford / ogb

Benchmark datasets, data loaders, and evaluators for graph machine learning
https://ogb.stanford.edu
MIT License
1.93k stars 397 forks source link

Negative sampling during training for link prediction #82

Closed chaitjo closed 3 years ago

chaitjo commented 3 years ago

Hi OGB team, Quick Q. on negative sampling during training for DDI vs COLLAB: Is there a fundamental difference between the two approaches? Can we use the COLLAB approach to negative sampling in DDI, too?

COLLAB: https://github.com/snap-stanford/ogb/blob/330a3515f8677464743745d2abe336592140a948/examples/linkproppred/collab/gnn.py#L113

DDI: https://github.com/snap-stanford/ogb/blob/330a3515f8677464743745d2abe336592140a948/examples/linkproppred/ddi/gnn.py#L118

weihua916 commented 3 years ago

Hi! Yes you definitely can. We used strict negative sampling for ogbl-ddi because ogbl-ddi is really a dense graph; hence, there will be lots of false positives in your negative samples if you do random negative sampling.

Besides, please be aware of the slight difference of rules for the ogbl-collab: https://ogb.stanford.edu/docs/leader_rules/

chaitjo commented 3 years ago

Thanks for the prompt response!