pytorch_cluster icon indicating copy to clipboard operation
pytorch_cluster copied to clipboard

Implement weighted random walks

Open pbielak opened this issue 3 years ago • 8 comments

This commit implements weighted biased random walks as in the original Node2vec paper. In particular, it adds a new parameter to the random_walk function, i.e., edge_weight, which allows passing edge weights to the underlying random walk generation procedure. If edge weights are set, the function normalizes them by the node degree and converts the weights into CDFs over given nodes (needed by the rejection sampling method). The implementation of the new rejection sampling method is based on [1].

[1] https://github.com/louisabraham/fastnode2vec/blob/master/fastnode2vec/graph.py#L69

  • Update random_walk API
  • Implement weighted rejection sampling on CPU
  • Implement weighted random walk for GPU (CUDA)
  • Compute CDFs using C++/CUDA
  • Add tests for weighted random walks

pbielak avatar Aug 10 '22 15:08 pbielak

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.63%. Comparing base (cc4696b) to head (2b63087). Report is 22 commits behind head on master.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##            master     #140      +/-   ##
===========================================
- Coverage   100.00%   98.63%   -1.37%     
===========================================
  Files            9       11       +2     
  Lines           77      146      +69     
===========================================
+ Hits            77      144      +67     
- Misses           0        2       +2     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Aug 10 '22 15:08 codecov-commenter

Thank you @pbielak, will have a look ASAP.

rusty1s avatar Aug 11 '22 09:08 rusty1s

Hi, I am highly interested in this pull request :), is there any way this could be merged? Thanks :)

Alvaro-Ciudad avatar Feb 15 '23 20:02 Alvaro-Ciudad

This pull request had no activity for 6 months. It will be closed in 2 weeks unless there is some new activity.

github-actions[bot] avatar Aug 15 '23 00:08 github-actions[bot]

Hello, is there any chance, this will be implemented?

AmosDinh avatar Oct 11 '23 21:10 AmosDinh

This pull request had no activity for 6 months. It will be closed in 2 weeks unless there is some new activity.

github-actions[bot] avatar Apr 09 '24 00:04 github-actions[bot]