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

Function learn_embeddings

easygraph/functions/graph_embedding/node2vec.py:295–308  ·  view source on GitHub ↗

Learn embeddings with Word2Vec.

(walks, dimensions, **skip_gram_params)

Source from the content-addressed store, hash-verified

293
294
295def learn_embeddings(walks, dimensions, **skip_gram_params):
296 """
297 Learn embeddings with Word2Vec.
298 """
299 from gensim.models import Word2Vec
300
301 walks = [list(map(str, walk)) for walk in walks]
302
303 if "vector_size" not in skip_gram_params:
304 skip_gram_params["vector_size"] = dimensions
305
306 model = Word2Vec(walks, **skip_gram_params)
307
308 return model

Callers 2

deepwalkFunction · 0.90
node2vecFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected