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

Method train

ge/models/struc2vec.py:109–121  ·  view source on GitHub ↗
(self, embed_size=128, window_size=5, workers=3, iter=5)

Source from the content-addressed store, hash-verified

107 pd.to_pickle(gamma, self.temp_path + 'gamma.pkl')
108
109 def train(self, embed_size=128, window_size=5, workers=3, iter=5):
110
111 # pd.read_pickle(self.temp_path+'walks.pkl')
112 sentences = self.sentences
113
114 print("Learning representation...")
115 model = Word2Vec(sentences, vector_size=embed_size, window=window_size, min_count=0, hs=1, sg=1,
116 workers=workers,
117 epochs=iter)
118 print("Learning representation done!")
119 self.w2v_model = model
120
121 return model
122
123 def get_embeddings(self, ):
124 if self.w2v_model is None:

Callers 2

test_Struc2VecFunction · 0.95
mainFunction · 0.95

Calls

no outgoing calls

Tested by 1

test_Struc2VecFunction · 0.76