pytorch_cluster
pytorch_cluster copied to clipboard
Implement weighted random walks
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_walkAPI - Implement weighted rejection sampling on CPU
- Implement weighted random walk for GPU (CUDA)
- Compute CDFs using C++/CUDA
- Add tests for weighted random walks
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.
Thank you @pbielak, will have a look ASAP.
Hi, I am highly interested in this pull request :), is there any way this could be merged? Thanks :)
This pull request had no activity for 6 months. It will be closed in 2 weeks unless there is some new activity.
Hello, is there any chance, this will be implemented?
This pull request had no activity for 6 months. It will be closed in 2 weeks unless there is some new activity.