Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
book
提交
c0ffccb1
B
book
项目概览
PaddlePaddle
/
book
通知
16
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
40
列表
看板
标记
里程碑
合并请求
37
Wiki
5
Wiki
分析
仓库
DevOps
项目成员
Pages
B
book
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
40
Issue
40
列表
看板
标记
里程碑
合并请求
37
合并请求
37
Pages
分析
分析
仓库分析
DevOps
Wiki
5
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c0ffccb1
编写于
2月 28, 2017
作者:
Y
Yuanpeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Translate Commands and Logs.
上级
16c1bd14
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
51 addition
and
0 deletion
+51
-0
recognize_digits/README.en.md
recognize_digits/README.en.md
+51
-0
未找到文件。
recognize_digits/README.en.md
浏览文件 @
c0ffccb1
...
@@ -566,6 +566,8 @@ def convolutional_neural_network(img):
...
@@ -566,6 +566,8 @@ def convolutional_neural_network(img):
## 训练模型
## 训练模型
## Training Model
### 训练命令及日志
### 训练命令及日志
1.
通过配置训练脚本
`train.sh`
来执行训练过程:
1.
通过配置训练脚本
`train.sh`
来执行训练过程:
...
@@ -615,6 +617,55 @@ python plot_cost.py softmax_train.log
...
@@ -615,6 +617,55 @@ python plot_cost.py softmax_train.log
python evaluate.py softmax_train.log
python evaluate.py softmax_train.log
```
```
### Training Commands and Logs
1.
By configuring
`train.sh`
to execute training:
```
bash
config
=
mnist_model.py
# Select network in mnist_model.py
output
=
./softmax_mnist_model
log
=
softmax_train.log
paddle train
\
--config
=
$config
\
# Scripts for network configuration.
--dot_period
=
10
\
# After `dot_period` steps, print one `.`
--log_period
=
100
\
# Print a log every batchs
--test_all_data_in_one_period
=
1
\
# Whether to use all data in every test
--use_gpu
=
0
\
# Whether to use GPU
--trainer_count
=
1
\
# Number of CPU or GPU
--num_passes
=
100
\
# Passes for training (One pass uses all data.)
--save_dir
=
$output
\
# Path to saved model
2>&1 |
tee
$log
python
-m
paddle.utils.plotcurve
-i
$log
>
plot.png
```
After configuring parameters, execute
`./train.sh`
. Training log is as follows.
```
I0117 12:52:29.628617 4538 TrainerInternal.cpp:165] Batch=100 samples=12800 AvgCost=2.63996 CurrentCost=2.63996 Eval: classification_error_evaluator=0.241172 CurrentEval: classification_error_evaluator=0.241172
.........
I0117 12:52:29.768741 4538 TrainerInternal.cpp:165] Batch=200 samples=25600 AvgCost=1.74027 CurrentCost=0.840582 Eval: classification_error_evaluator=0.185234 CurrentEval: classification_error_evaluator=0.129297
.........
I0117 12:52:29.916970 4538 TrainerInternal.cpp:165] Batch=300 samples=38400 AvgCost=1.42119 CurrentCost=0.783026 Eval: classification_error_evaluator=0.167786 CurrentEval: classification_error_evaluator=0.132891
.........
I0117 12:52:30.061213 4538 TrainerInternal.cpp:165] Batch=400 samples=51200 AvgCost=1.23965 CurrentCost=0.695054 Eval: classification_error_evaluator=0.160039 CurrentEval: classification_error_evaluator=0.136797
......I0117 12:52:30.223270 4538 TrainerInternal.cpp:181] Pass=0 Batch=469 samples=60000 AvgCost=1.1628 Eval: classification_error_evaluator=0.156233
I0117 12:52:30.366894 4538 Tester.cpp:109] Test samples=10000 cost=0.50777 Eval: classification_error_evaluator=0.0978
```
2.
Use
`plot_cost.py`
to plot error curve during training.
```
bash
python plot_cost.py softmax_train.log
```
3.
Use
`evaluate.py `
to select the best trained model.
```
bash
python evaluate.py softmax_train.log
```
### softmax回归的训练结果
### softmax回归的训练结果
<p
align=
"center"
>
<p
align=
"center"
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录