Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
70d9d953
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
70d9d953
编写于
10月 23, 2017
作者:
L
Luo Tao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename sparse_vector to sparse_float_vector in tests
上级
c2feab7f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
6 deletion
+9
-6
paddle/gserver/tests/test_PyDataProvider2.py
paddle/gserver/tests/test_PyDataProvider2.py
+4
-1
python/paddle/trainer/PyDataProvider2.py
python/paddle/trainer/PyDataProvider2.py
+4
-4
python/paddle/v2/tests/test_data_feeder.py
python/paddle/v2/tests/test_data_feeder.py
+1
-1
未找到文件。
paddle/gserver/tests/test_PyDataProvider2.py
浏览文件 @
70d9d953
...
@@ -51,7 +51,10 @@ def test_sparse_non_value_no_seq(setting, filename):
...
@@ -51,7 +51,10 @@ def test_sparse_non_value_no_seq(setting, filename):
yield
[(
i
+
1
)
*
(
j
+
1
)
for
j
in
xrange
(
10
)]
yield
[(
i
+
1
)
*
(
j
+
1
)
for
j
in
xrange
(
10
)]
@
provider
(
input_types
=
[
sparse_vector
(
30000
,
seq_type
=
SequenceType
.
NO_SEQUENCE
)])
@
provider
(
input_types
=
[
sparse_float_vector
(
30000
,
seq_type
=
SequenceType
.
NO_SEQUENCE
)
])
def
test_sparse_value_no_seq
(
setting
,
filename
):
def
test_sparse_value_no_seq
(
setting
,
filename
):
for
i
in
xrange
(
200
):
for
i
in
xrange
(
200
):
yield
[((
i
+
1
)
*
(
j
+
1
),
float
(
j
)
/
float
(
i
+
1
))
for
j
in
xrange
(
10
)]
yield
[((
i
+
1
)
*
(
j
+
1
),
float
(
j
)
/
float
(
i
+
1
))
for
j
in
xrange
(
10
)]
...
...
python/paddle/trainer/PyDataProvider2.py
浏览文件 @
70d9d953
...
@@ -216,7 +216,7 @@ def sparse_binary_vector_sub_sequence(dim):
...
@@ -216,7 +216,7 @@ def sparse_binary_vector_sub_sequence(dim):
return
sparse_binary_vector
(
dim
,
seq_type
=
SequenceType
.
SUB_SEQUENCE
)
return
sparse_binary_vector
(
dim
,
seq_type
=
SequenceType
.
SUB_SEQUENCE
)
def
sparse_vector_sequence
(
dim
):
def
sparse_
float_
vector_sequence
(
dim
):
"""
"""
Data type of a sequence of sparse vector, which most elements are zero,
Data type of a sequence of sparse vector, which most elements are zero,
others could be any float value.
others could be any float value.
...
@@ -226,11 +226,11 @@ def sparse_vector_sequence(dim):
...
@@ -226,11 +226,11 @@ def sparse_vector_sequence(dim):
:return: An input type object
:return: An input type object
:rtype: InputType
:rtype: InputType
"""
"""
return
sparse_vector
(
dim
,
seq_type
=
SequenceType
.
SEQUENCE
)
return
sparse_
float_
vector
(
dim
,
seq_type
=
SequenceType
.
SEQUENCE
)
def
sparse_vector_sub_sequence
(
dim
):
def
sparse_
float_
vector_sub_sequence
(
dim
):
return
sparse_vector
(
dim
,
seq_type
=
SequenceType
.
SUB_SEQUENCE
)
return
sparse_
float_
vector
(
dim
,
seq_type
=
SequenceType
.
SUB_SEQUENCE
)
def
integer_value_sequence
(
value_range
):
def
integer_value_sequence
(
value_range
):
...
...
python/paddle/v2/tests/test_data_feeder.py
浏览文件 @
70d9d953
...
@@ -97,7 +97,7 @@ class DataFeederTest(unittest.TestCase):
...
@@ -97,7 +97,7 @@ class DataFeederTest(unittest.TestCase):
each_sample
.
append
(
zip
(
a
,
b
))
each_sample
.
append
(
zip
(
a
,
b
))
data
.
append
(
each_sample
)
data
.
append
(
each_sample
)
feeder
=
DataFeeder
([(
'input'
,
data_type
.
sparse_vector
(
dim
))],
feeder
=
DataFeeder
([(
'input'
,
data_type
.
sparse_
float_
vector
(
dim
))],
{
'input'
:
0
})
{
'input'
:
0
})
arg
=
feeder
(
data
)
arg
=
feeder
(
data
)
output
=
arg
.
getSlotValue
(
0
)
output
=
arg
.
getSlotValue
(
0
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录