提交 b872d21a 编写于 作者: J JiabinYang

insert header files and change the print() to match python3 style

上级 5513a343
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册