提交 24659091 编写于 作者: J JiabinYang

fix 01 branch wrong changes

上级 d5c501fa
...@@ -180,7 +180,7 @@ feed_order=['x', 'y'] ...@@ -180,7 +180,7 @@ feed_order=['x', 'y']
除此之外,可以定义一个事件相应器来处理类似`打印训练进程`的事件: 除此之外,可以定义一个事件相应器来处理类似`打印训练进程`的事件:
```python ```python
# Specify the directory path to save the parameters # Specify the directory to save the parameters
params_dirname = "fit_a_line.inference.model" params_dirname = "fit_a_line.inference.model"
# Plot data # Plot data
...@@ -191,11 +191,11 @@ plot_cost = Ploter(train_title, test_title) ...@@ -191,11 +191,11 @@ plot_cost = Ploter(train_title, test_title)
step = 0 step = 0
# event_handler to print training and testing info # event_handler prints training and testing info
def event_handler_plot(event): def event_handler_plot(event):
global step global step
if isinstance(event, fluid.EndStepEvent): if isinstance(event, fluid.EndStepEvent):
if event.step % 10 == 0: # every 10 batches, record a test cost if event.step % 10 == 0: # record the test cost every 10 seconds
test_metrics = trainer.test( test_metrics = trainer.test(
reader=test_reader, feed_order=feed_order) reader=test_reader, feed_order=feed_order)
......
01.fit_a_line/image/ranges.png

6.5 KB | W: | H:

01.fit_a_line/image/ranges.png

6.6 KB | W: | H:

01.fit_a_line/image/ranges.png
01.fit_a_line/image/ranges.png
01.fit_a_line/image/ranges.png
01.fit_a_line/image/ranges.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -222,7 +222,7 @@ feed_order=['x', 'y'] ...@@ -222,7 +222,7 @@ feed_order=['x', 'y']
除此之外,可以定义一个事件相应器来处理类似`打印训练进程`的事件: 除此之外,可以定义一个事件相应器来处理类似`打印训练进程`的事件:
```python ```python
# Specify the directory path to save the parameters # Specify the directory to save the parameters
params_dirname = "fit_a_line.inference.model" params_dirname = "fit_a_line.inference.model"
# Plot data # Plot data
...@@ -233,11 +233,11 @@ plot_cost = Ploter(train_title, test_title) ...@@ -233,11 +233,11 @@ plot_cost = Ploter(train_title, test_title)
step = 0 step = 0
# event_handler to print training and testing info # event_handler prints training and testing info
def event_handler_plot(event): def event_handler_plot(event):
global step global step
if isinstance(event, fluid.EndStepEvent): if isinstance(event, fluid.EndStepEvent):
if event.step % 10 == 0: # every 10 batches, record a test cost if event.step % 10 == 0: # record the test cost every 10 seconds
test_metrics = trainer.test( test_metrics = trainer.test(
reader=test_reader, feed_order=feed_order) reader=test_reader, feed_order=feed_order)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册