Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
bb625337
P
PaddleDetection
项目概览
s920243400
/
PaddleDetection
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleDetection
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
bb625337
编写于
2月 22, 2017
作者:
D
dangqingqing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add some comments
上级
6cf56035
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
41 addition
and
1 deletion
+41
-1
python/paddle/v2/data_feeder.py
python/paddle/v2/data_feeder.py
+41
-0
python/paddle/v2/trainer.py
python/paddle/v2/trainer.py
+0
-1
未找到文件。
python/paddle/v2/data_feeder.py
浏览文件 @
bb625337
...
...
@@ -15,5 +15,46 @@
from
py_paddle
import
DataProviderConverter
__all__
=
[
'DataFeeder'
]
"""
DataFeeder converts the data returned by paddle.reader into a data structure
of Arguments which is defined in the API. The paddle.reader usually returns
a list of mini-batch data. Each item in the list is a tuple or list, which is
one sample with multiple features. DataFeeder converts this mini-batch data
into Arguments in order to feed it to C++ interface.
The example usage:
data_types = [paddle.data_type.dense_vector(784),
paddle.data_type.integer_value(10)]
feeder = DataFeeder(input_types=data_types)
minibatch_data = [
( [1.0,2.0,3.0,4.0], 5, [6,7,8] ), # first sample
( [1.0,2.0,3.0,4.0], 5, [6,7,8] ) # second sample
]
# or
# minibatch_data = [
# [ [1.0,2.0,3.0,4.0], 5, [6,7,8] ], # first sample
# [ [1.0,2.0,3.0,4.0], 5, [6,7,8] ] # second sample
# ]
arg = feeder(minibatch_data)
Args:
input_types: A list of input data types. It's length is equal to the length
of data returned by paddle.reader. Each item specifies the type
of each feature.
mintbatch_data: A list of mini-batch data. Each item is a list or tuple,
for example:
[
(feature_0, feature_1, feature_2, ...), # first sample
(feature_0, feature_1, feature_2, ...), # second sample
...
]
Returns:
An Arguments object contains this mini-batch data with multiple features.
The Arguments definition is in the API.
"""
DataFeeder
=
DataProviderConverter
python/paddle/v2/trainer.py
浏览文件 @
bb625337
...
...
@@ -89,7 +89,6 @@ class SGD(ITrainer):
event_handler
=
default_event_handler
topology
=
v2_layer
.
parse_network
(
topology
)
print
topology
__check_train_args__
(
**
locals
())
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录