Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
89cfb39f
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
89cfb39f
编写于
2月 20, 2017
作者:
Q
qiaolongfei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use data_type of data layer
上级
772b476b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
5 addition
and
5 deletion
+5
-5
demo/mnist/api_train.py
demo/mnist/api_train.py
+1
-1
demo/mnist/api_train_v2.py
demo/mnist/api_train_v2.py
+2
-2
python/paddle/v2/layer.py
python/paddle/v2/layer.py
+2
-2
未找到文件。
demo/mnist/api_train.py
浏览文件 @
89cfb39f
...
@@ -99,7 +99,7 @@ def main():
...
@@ -99,7 +99,7 @@ def main():
# DataProvider Converter is a utility convert Python Object to Paddle C++
# DataProvider Converter is a utility convert Python Object to Paddle C++
# Input. The input format is as same as Paddle's DataProvider.
# Input. The input format is as same as Paddle's DataProvider.
converter
=
DataProviderConverter
(
converter
=
DataProviderConverter
(
input_types
=
[
dp
.
dense_vector
(
784
),
dp
.
integer_value
(
10
)
])
input_types
=
[
images
.
data_type
,
label
.
data_type
])
train_file
=
'./data/raw_data/train'
train_file
=
'./data/raw_data/train'
test_file
=
'./data/raw_data/t10k'
test_file
=
'./data/raw_data/t10k'
...
...
demo/mnist/api_train_v2.py
浏览文件 @
89cfb39f
...
@@ -51,8 +51,8 @@ def main():
...
@@ -51,8 +51,8 @@ def main():
batch_size
=
32
,
# batch size should be refactor in Data reader
batch_size
=
32
,
# batch size should be refactor in Data reader
data_types
=
{
# data_types will be removed, It should be in
data_types
=
{
# data_types will be removed, It should be in
# network topology
# network topology
'pixel'
:
dense_vector
(
784
)
,
'pixel'
:
images
.
data_type
,
'label'
:
integer_value
(
10
)
'label'
:
label
.
data_type
})
})
...
...
python/paddle/v2/layer.py
浏览文件 @
89cfb39f
...
@@ -168,15 +168,15 @@ class DataLayerV2(Layer):
...
@@ -168,15 +168,15 @@ class DataLayerV2(Layer):
def
__init__
(
self
,
name
,
data_type
,
**
kwargs
):
def
__init__
(
self
,
name
,
data_type
,
**
kwargs
):
assert
isinstance
(
data_type
,
dp
.
InputType
)
assert
isinstance
(
data_type
,
dp
.
InputType
)
self
.
data_type
=
data_type
self
.
__method_name__
=
'data_layer'
self
.
__method_name__
=
'data_layer'
self
.
__kwargs__
=
kwargs
self
.
__kwargs__
=
kwargs
self
.
__data_size__
=
data_type
.
dim
super
(
DataLayerV2
,
self
).
__init__
(
name
=
name
,
parent_layers
=
dict
())
super
(
DataLayerV2
,
self
).
__init__
(
name
=
name
,
parent_layers
=
dict
())
def
to_proto_impl
(
self
,
**
kwargs
):
def
to_proto_impl
(
self
,
**
kwargs
):
args
=
dict
()
args
=
dict
()
args
[
'size'
]
=
self
.
__data_size__
args
[
'size'
]
=
self
.
data_type
.
dim
for
each
in
kwargs
:
for
each
in
kwargs
:
args
[
each
]
=
kwargs
[
each
]
args
[
each
]
=
kwargs
[
each
]
for
each
in
self
.
__kwargs__
:
for
each
in
self
.
__kwargs__
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录