MCPcopy Index your code
hub / github.com/shenweichen/GraphEmbedding / deepwalk_walk

Method deepwalk_walk

ge/walker.py:25–36  ·  view source on GitHub ↗
(self, walk_length, start_node)

Source from the content-addressed store, hash-verified

23 self.use_rejection_sampling = use_rejection_sampling
24
25 def deepwalk_walk(self, walk_length, start_node):
26
27 walk = [start_node]
28
29 while len(walk) < walk_length:
30 cur = walk[-1]
31 cur_nbrs = list(self.G.neighbors(cur))
32 if len(cur_nbrs) > 0:
33 walk.append(random.choice(cur_nbrs))
34 else:
35 break
36 return walk
37
38 def node2vec_walk(self, walk_length, start_node):
39

Callers 1

_simulate_walksMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected