Skip to content

Commit e98df00

Browse files
authored
Merge pull request #45 from ldorigo/patch-1
Small fix to ensure that status gets printed to console
2 parents 5acc519 + 713c5d1 commit e98df00

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

nodevectors/node2vec.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@ def fit(self, G):
101101
# Adjacency matrix
102102
walks_t = time.time()
103103
if self.verbose:
104-
print("Making walks...", end=" ")
104+
print("Making walks...", end=" ", flush=True)
105105
self.walks = G.random_walks(walklen=self.walklen,
106106
epochs=self.epochs,
107107
return_weight=self.return_weight,
108108
neighbor_weight=self.neighbor_weight)
109109
if self.verbose:
110110
print(f"Done, T={time.time() - walks_t:.2f}")
111-
print("Mapping Walk Names...", end=" ")
111+
print("Mapping Walk Names...", end=" ", flush=True)
112112
map_t = time.time()
113113
self.walks = pd.DataFrame(self.walks)
114114
# Map nodeId -> node name
@@ -120,7 +120,7 @@ def fit(self, G):
120120
self.walks = [list(x) for x in self.walks.itertuples(False, None)]
121121
if self.verbose:
122122
print(f"Done, T={time.time() - map_t:.2f}")
123-
print("Training W2V...", end=" ")
123+
print("Training W2V...", end=" ", flush=True)
124124
if gensim.models.word2vec.FAST_VERSION < 1:
125125
print("WARNING: gensim word2vec version is unoptimized"
126126
"Try version 3.6 if on windows, versions 3.7 "
@@ -179,4 +179,4 @@ def load_vectors(self, out_file):
179179
"""
180180
Load embeddings from gensim.models.KeyedVectors format
181181
"""
182-
self.model = gensim.wv.load_word2vec_format(out_file)
182+
self.model = gensim.wv.load_word2vec_format(out_file)

0 commit comments

Comments
 (0)