diff --git a/01.fit_a_line/README.cn.md b/01.fit_a_line/README.cn.md index ae33f48fe7ec4742b6fca56b17d76d95b1c05b40..a969c752767a575d78e86bd51d763702b91eb551 100644 --- a/01.fit_a_line/README.cn.md +++ b/01.fit_a_line/README.cn.md @@ -180,7 +180,7 @@ feed_order=['x', 'y'] 除此之外,可以定义一个事件相应器来处理类似`打印训练进程`的事件: ```python -# Specify the directory path to save the parameters +# Specify the directory to save the parameters params_dirname = "fit_a_line.inference.model" # Plot data @@ -191,11 +191,11 @@ plot_cost = Ploter(train_title, test_title) step = 0 -# event_handler to print training and testing info +# event_handler prints training and testing info def event_handler_plot(event): global step 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( reader=test_reader, feed_order=feed_order) diff --git a/01.fit_a_line/image/ranges.png b/01.fit_a_line/image/ranges.png index 5d86b12715f46afbafb7d50e2938e184219b5b95..5325df4800985983e17476f007658d1cdb170b1c 100644 Binary files a/01.fit_a_line/image/ranges.png and b/01.fit_a_line/image/ranges.png differ diff --git a/01.fit_a_line/index.cn.html b/01.fit_a_line/index.cn.html index f8a13b7744eb7b11c63bea328bc1222c730760d2..9a0b9918dcbbb31c4615908b3cc323eb59b36835 100644 --- a/01.fit_a_line/index.cn.html +++ b/01.fit_a_line/index.cn.html @@ -222,7 +222,7 @@ feed_order=['x', 'y'] 除此之外,可以定义一个事件相应器来处理类似`打印训练进程`的事件: ```python -# Specify the directory path to save the parameters +# Specify the directory to save the parameters params_dirname = "fit_a_line.inference.model" # Plot data @@ -233,11 +233,11 @@ plot_cost = Ploter(train_title, test_title) step = 0 -# event_handler to print training and testing info +# event_handler prints training and testing info def event_handler_plot(event): global step 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( reader=test_reader, feed_order=feed_order)