MCPcopy Create free account
hub / github.com/easy-graph/Easy-Graph / _alias_draw

Function _alias_draw

easygraph/functions/graph_embedding/node2vec.py:286–292  ·  view source on GitHub ↗
(J, q)

Source from the content-addressed store, hash-verified

284
285
286def _alias_draw(J, q):
287 K = len(J)
288 kk = int(np.floor(np.random.rand() * K))
289 if np.random.rand() < q[kk]:
290 return kk
291 else:
292 return J[kk]
293
294
295def learn_embeddings(walks, dimensions, **skip_gram_params):

Callers 1

_node2vec_walkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected