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

Update API for node2vec and biased random walks #4841

Open
wants to merge 27 commits into
base: branch-25.02
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
86b2038
add support for rng state
jnke2016 Dec 28, 2024
38690a6
update test to take rng state parameter
jnke2016 Dec 28, 2024
fd5b387
add support for rng state
jnke2016 Dec 28, 2024
9d56b5f
deprecate old API
jnke2016 Dec 28, 2024
615837e
add new API for node2vec random walks
jnke2016 Dec 28, 2024
21a76bb
add mg node2vec random walks to the python API
jnke2016 Dec 28, 2024
86a13d3
update docstrings
jnke2016 Dec 28, 2024
4c8744f
enable mg node2vec_random walks
jnke2016 Dec 28, 2024
4da1c7e
update argument list in function call
jnke2016 Dec 28, 2024
6984645
support optional weights
jnke2016 Dec 28, 2024
d04588a
update docstring and deprecate arguments
jnke2016 Dec 31, 2024
cb6a294
add new API for uniform_random_walks
jnke2016 Dec 31, 2024
7936026
deprecate method
jnke2016 Dec 31, 2024
7a5056f
update copyrights
jnke2016 Dec 31, 2024
e2e4694
add uniform random walks
jnke2016 Dec 31, 2024
877265b
add new API for node2vec random walks
jnke2016 Dec 31, 2024
bb77237
deprecate legacy implementation
jnke2016 Dec 31, 2024
618fe76
add random state argumment and update copyright
jnke2016 Dec 31, 2024
a1d004c
update header file to take as input a random state
jnke2016 Dec 31, 2024
bea2a2f
add support for rng state as input
jnke2016 Dec 31, 2024
755acc7
update tests to support rng state as input
jnke2016 Dec 31, 2024
ef00fa5
add biased random walks to the PLC API
jnke2016 Jan 1, 2025
ae4833c
add biased random walks to the python API
jnke2016 Jan 1, 2025
8314291
update docstrings and init file
jnke2016 Jan 1, 2025
1603bcd
fix typo
jnke2016 Jan 1, 2025
0a03b29
update copyright
jnke2016 Jan 1, 2025
88e405d
add mg implementation of biased and uniform random walks
jnke2016 Jan 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update docstrings and init file
  • Loading branch information
jnke2016 committed Jan 1, 2025
commit 8314291b37b31e0479db4478c34825361cf49ba8
1 change: 1 addition & 0 deletions python/cugraph/cugraph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
random_walks,
uniform_random_walks,
biased_random_walks,
node2vec_random_walks,
rw_path,
node2vec,
uniform_neighbor_sample,
Expand Down
2 changes: 2 additions & 0 deletions python/cugraph/cugraph/dask/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
from .components.connectivity import weakly_connected_components
from .sampling.uniform_neighbor_sample import uniform_neighbor_sample
from .sampling.random_walks import random_walks
from .sampling.uniform_random_walks import uniform_random_walks
from .sampling.biased_random_walks import biased_random_walks
from .sampling.node2vec_random_walks import node2vec_random_walks
from .centrality.eigenvector_centrality import eigenvector_centrality
from .cores.core_number import core_number
Expand Down
12 changes: 9 additions & 3 deletions python/cugraph/cugraph/dask/sampling/node2vec_random_walks.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ def node2vec_random_walks(
random_state=None
):
"""
Computes random walks for each node in 'start_vertices', under the
node2vec sampling framework.
compute random walks under the node2vec sampling framework for each nodes in
'start_vertices' and returns a padded result along with the maximum path length.
Vertices with no outgoing edges will be padded with -1.

parameters
----------
Expand Down Expand Up @@ -112,6 +113,11 @@ def node2vec_random_walks(
edge_weight_paths: dask_cudf.Series
Series containing the edge weights of edges represented by the
returned vertex_paths

and

max_path_length : int
The maximum path length.
"""
client = default_client()

Expand Down Expand Up @@ -194,5 +200,5 @@ def node2vec_random_walks(
]
)

return ddf_vertex_paths, ddf_edge_wgt_paths
return ddf_vertex_paths, ddf_edge_wgt_paths, max_depth

1 change: 1 addition & 0 deletions python/cugraph/cugraph/sampling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
from cugraph.sampling.random_walks import random_walks, rw_path
from cugraph.sampling.uniform_random_walks import uniform_random_walks
from cugraph.sampling.biased_random_walks import biased_random_walks
from cugraph.sampling.node2vec_random_walks import node2vec_random_walks
from cugraph.sampling.node2vec import node2vec
from cugraph.sampling.uniform_neighbor_sample import uniform_neighbor_sample