You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def get_subgraph_embedding(embeddings_model_file):
embedding_word_size = 0
embedding_dims = 0
word_embeddings = {}
print("Loading embedding model %s" %(embeddings_model_file))
with open(embeddings_model_file) as fh:
# skip first line
embedding_word_size, embedding_dims = fh.readline().rstrip().split()
embedding_word_size = int(embedding_word_size)
embedding_dims = int(embedding_dims)
print('sub2Vec Info : %d X %d' %(embedding_word_size, embedding_dims))
for line in fh.readlines():
values = line.rstrip().split()
word = values[0]
# embedding = np.asarray(values[1:], dtype=np.float64)
rand_seed = np.uint32(hash(word))
np.random.seed(rand_seed)
embedding = np.random.randn(embedding_dims)
word_embeddings[word] = embedding
return embedding_word_size, embedding_dims, word_embeddings
I change it to py3, and using randomly generated vectors,and got better result。
So I'm trying to keep thinking scientifically.
Use subgraphs to encode the full graph,
Does the vector of the subgraph have to be important,that we got it from skipgram or randomly generated vector
The text was updated successfully, but these errors were encountered:
I change it to py3, and using randomly generated vectors,and got better result。
So I'm trying to keep thinking scientifically.
Use subgraphs to encode the full graph,
Does the vector of the subgraph have to be important,that we got it from skipgram or randomly generated vector
The text was updated successfully, but these errors were encountered: