diff --git a/04.word2vec/README.cn.md b/04.word2vec/README.cn.md index 9b6a17d68ee36d486240fba5af54fa40ca585022..450d469334f62120b4237699c934d5d8565059d9 100644 --- a/04.word2vec/README.cn.md +++ b/04.word2vec/README.cn.md @@ -204,6 +204,7 @@ from functools import partial import math import os import sys +from __future__ import print_function ``` 然后,定义参数: @@ -311,7 +312,7 @@ def train(use_cuda, train_program, params_dirname): feed_order=['firstw', 'secondw', 'thirdw', 'fourthw', 'nextw']) avg_cost = outs[0] - print "Step %d: Average Cost %f" % (event.step, avg_cost) + print("Step %d: Average Cost %f" % (event.step, avg_cost)) # If average cost is lower than 5.8, we consider the model good enough to stop. # Note 5.8 is a relatively high value. In order to get a better model, one should diff --git a/04.word2vec/README.md b/04.word2vec/README.md index e99d5336b64dd57dec34e704256aef4eb36c7db9..98598cddb541f7ebae89d22f1cafe450d77bd443 100644 --- a/04.word2vec/README.md +++ b/04.word2vec/README.md @@ -222,6 +222,7 @@ from functools import partial import math import os import sys +from __future__ import print_function ``` - Configure parameters and build word dictionary. @@ -328,7 +329,7 @@ def train(use_cuda, train_program, params_dirname): # We output cost every 10 steps. if event.step % 10 == 0: - print "Step %d: Average Cost %f" % (event.step, avg_cost) + print("Step %d: Average Cost %f" % (event.step, avg_cost)) # If average cost is lower than 5.8, we consider the model good enough to stop. # Note 5.8 is a relatively high value. In order to get a better model, one should diff --git a/04.word2vec/index.cn.html b/04.word2vec/index.cn.html index b55d3b35af29497b46fb910f4d07afac7c0f7b94..6f0ec9ce65250c9b3b162375eeb4be9e47714080 100644 --- a/04.word2vec/index.cn.html +++ b/04.word2vec/index.cn.html @@ -246,6 +246,7 @@ from functools import partial import math import os import sys +from __future__ import print_function ``` 然后,定义参数: @@ -353,7 +354,7 @@ def train(use_cuda, train_program, params_dirname): feed_order=['firstw', 'secondw', 'thirdw', 'fourthw', 'nextw']) avg_cost = outs[0] - print "Step %d: Average Cost %f" % (event.step, avg_cost) + print("Step %d: Average Cost %f" % (event.step, avg_cost)) # If average cost is lower than 5.8, we consider the model good enough to stop. # Note 5.8 is a relatively high value. In order to get a better model, one should diff --git a/04.word2vec/index.html b/04.word2vec/index.html index 4208db87c3a9820ad5ab6f912cd27184c61b8d34..cc3f04c1556075626722d9525be1d11a7567bd55 100644 --- a/04.word2vec/index.html +++ b/04.word2vec/index.html @@ -264,6 +264,7 @@ from functools import partial import math import os import sys +from __future__ import print_function ``` - Configure parameters and build word dictionary. @@ -370,7 +371,7 @@ def train(use_cuda, train_program, params_dirname): # We output cost every 10 steps. if event.step % 10 == 0: - print "Step %d: Average Cost %f" % (event.step, avg_cost) + print("Step %d: Average Cost %f" % (event.step, avg_cost)) # If average cost is lower than 5.8, we consider the model good enough to stop. # Note 5.8 is a relatively high value. In order to get a better model, one should