Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
book
提交
565baefe
B
book
项目概览
PaddlePaddle
/
book
通知
17
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看板
提交
565baefe
编写于
2月 28, 2017
作者:
Y
Yuanpeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Translate Data Definition.
上级
81361f1d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
1 deletion
+19
-1
recognize_digits/README.en.md
recognize_digits/README.en.md
+19
-1
未找到文件。
recognize_digits/README.en.md
浏览文件 @
565baefe
...
...
@@ -317,7 +317,7 @@ We use python interface to convey data to system. `mnist_provider.py` shows a co
def
process
(
settings
,
filename
):
# settings is not used currently.
# Open image file
with
open
(
filename
+
"-images-idx3-ubyte"
,
"rb"
)
as
f
:
# Read first 4 parameters. magic is data format. n is number of data
,
rows and cols are number of rows and columns, respectively
# Read first 4 parameters. magic is data format. n is number of data
.
rows and cols are number of rows and columns, respectively
magic
,
n
,
rows
,
cols
=
struct
.
upack
(
">IIII"
,
f
.
read
(
16
))
# With empty string as a unit, read data one by one
images
=
np
.
fromfile
(
...
...
@@ -341,6 +341,8 @@ def process(settings, filename): # settings is not used currently.
## 模型配置说明
## Model Configurations
### 数据定义
在模型配置中,定义通过
`define_py_data_sources2`
函数从
`dataprovider`
中读入数据。如果该配置用于预测,则不需要数据定义部分。
...
...
@@ -355,6 +357,22 @@ def process(settings, filename): # settings is not used currently.
obj
=
'process'
)
```
### Data Definition
在模型配置中,定义通过
`define_py_data_sources2`
函数从
`dataprovider`
中读入数据。如果该配置用于预测,则不需要数据定义部分。
In model configuration, define data reading from
`dataprovider`
by
`define_py_data_sources2`
. If this configuration is used for prediction, data definition is not necessary.
```
python
if
not
is_predict
:
data_dir
=
'./data/'
define_py_data_sources2
(
train_list
=
data_dir
+
'train.list'
,
test_list
=
data_dir
+
'test.list'
,
module
=
'mnist_provider'
,
obj
=
'process'
)
```
### 算法配置
指定训练相关的参数。
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录