提交 0116e793 编写于 作者: L lujun

ses-2,fix review for pr-649,update ploter,test=develop

上级 644a9d36
...@@ -302,9 +302,9 @@ def event_handler(pass_id, batch_id, cost): ...@@ -302,9 +302,9 @@ def event_handler(pass_id, batch_id, cost):
```python ```python
from paddle.v2.plot import Ploter from paddle.v2.plot import Ploter
train_title = "Train cost" train_prompt = "Train cost"
test_title = "Test cost" test_prompt = "Test cost"
cost_ploter = Ploter(train_title, test_title) cost_ploter = Ploter(train_prompt, test_prompt)
# event_handler to plot a figure # event_handler to plot a figure
def event_handler_plot(ploter_title, step, cost): def event_handler_plot(ploter_title, step, cost):
...@@ -376,7 +376,7 @@ for epoch_id in epochs: ...@@ -376,7 +376,7 @@ for epoch_id in epochs:
fetch_list=[avg_loss, acc]) fetch_list=[avg_loss, acc])
if step % 100 == 0: if step % 100 == 0:
print("Pass %d, Batch %d, Cost %f" % (step, epoch_id, metrics[0])) print("Pass %d, Batch %d, Cost %f" % (step, epoch_id, metrics[0]))
event_handler_plot(train_title, step, metrics[0]) event_handler_plot(train_prompt, step, metrics[0])
step += 1 step += 1
# test for epoch # test for epoch
...@@ -385,7 +385,7 @@ for epoch_id in epochs: ...@@ -385,7 +385,7 @@ for epoch_id in epochs:
train_test_feed=feeder) train_test_feed=feeder)
print("Test with Epoch %d, avg_cost: %s, acc: %s" %(epoch_id, avg_loss_val, acc_val)) print("Test with Epoch %d, avg_cost: %s, acc: %s" %(epoch_id, avg_loss_val, acc_val))
event_handler_plot(test_title, step, metrics[0]) event_handler_plot(test_prompt, step, metrics[0])
lists.append((epoch_id, avg_loss_val, acc_val)) lists.append((epoch_id, avg_loss_val, acc_val))
if save_dirname is not None: if save_dirname is not None:
......
...@@ -344,9 +344,9 @@ def event_handler(pass_id, batch_id, cost): ...@@ -344,9 +344,9 @@ def event_handler(pass_id, batch_id, cost):
```python ```python
from paddle.v2.plot import Ploter from paddle.v2.plot import Ploter
train_title = "Train cost" train_prompt = "Train cost"
test_title = "Test cost" test_prompt = "Test cost"
cost_ploter = Ploter(train_title, test_title) cost_ploter = Ploter(train_prompt, test_prompt)
# event_handler to plot a figure # event_handler to plot a figure
def event_handler_plot(ploter_title, step, cost): def event_handler_plot(ploter_title, step, cost):
...@@ -418,7 +418,7 @@ for epoch_id in epochs: ...@@ -418,7 +418,7 @@ for epoch_id in epochs:
fetch_list=[avg_loss, acc]) fetch_list=[avg_loss, acc])
if step % 100 == 0: if step % 100 == 0:
print("Pass %d, Batch %d, Cost %f" % (step, epoch_id, metrics[0])) print("Pass %d, Batch %d, Cost %f" % (step, epoch_id, metrics[0]))
event_handler_plot(train_title, step, metrics[0]) event_handler_plot(train_prompt, step, metrics[0])
step += 1 step += 1
# test for epoch # test for epoch
...@@ -427,7 +427,7 @@ for epoch_id in epochs: ...@@ -427,7 +427,7 @@ for epoch_id in epochs:
train_test_feed=feeder) train_test_feed=feeder)
print("Test with Epoch %d, avg_cost: %s, acc: %s" %(epoch_id, avg_loss_val, acc_val)) print("Test with Epoch %d, avg_cost: %s, acc: %s" %(epoch_id, avg_loss_val, acc_val))
event_handler_plot(test_title, step, metrics[0]) event_handler_plot(test_prompt, step, metrics[0])
lists.append((epoch_id, avg_loss_val, acc_val)) lists.append((epoch_id, avg_loss_val, acc_val))
if save_dirname is not None: if save_dirname is not None:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册