Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
b97f020f
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看板
提交
b97f020f
编写于
8月 10, 2017
作者:
C
caoying03
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix unittest error.
上级
7ff689f5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
8 addition
and
17 deletion
+8
-17
paddle/gserver/layers/SequenceSliceLayer.cpp
paddle/gserver/layers/SequenceSliceLayer.cpp
+1
-2
python/paddle/trainer_config_helpers/layers.py
python/paddle/trainer_config_helpers/layers.py
+1
-0
python/paddle/trainer_config_helpers/tests/configs/protostr/test_kmax_seq_socre_layer.protostr
...tests/configs/protostr/test_kmax_seq_socre_layer.protostr
+5
-12
python/paddle/trainer_config_helpers/tests/configs/test_kmax_seq_socre_layer.py
...config_helpers/tests/configs/test_kmax_seq_socre_layer.py
+1
-3
未找到文件。
paddle/gserver/layers/SequenceSliceLayer.cpp
浏览文件 @
b97f020f
...
...
@@ -70,9 +70,8 @@ void SequenceSliceLayer::checkInputs() {
const
Argument
&
inputSeq
=
getInput
(
0
);
CHECK
(
inputSeq
.
hasSeq
())
<<
"The first input of sequence slic layer "
<<
"must be a sequence."
;
// Check inputs
const
MatrixPtr
indices1
=
getInputValue
(
1
);
CHECK_EQ
(
indices1
->
getHeight
(
),
CHECK_EQ
(
static_cast
<
size_t
>
(
indices1
->
getHeight
()
),
inputSeq
.
hasSubseq
()
?
inputSeq
.
getNumSubSequences
()
:
inputSeq
.
getNumSequences
())
<<
"Height of the second input should be equal to number of sequence "
...
...
python/paddle/trainer_config_helpers/layers.py
浏览文件 @
b97f020f
...
...
@@ -6242,6 +6242,7 @@ def seq_slice_layer(input, starts, ends, name=None):
name
,
LayerType
.
SEQ_SLICE
,
parents
=
[
input
],
size
=
input
.
size
)
@
wrap_name_default
()
@
layer_support
()
def
kmax_sequence_score_layer
(
input
,
name
=
None
,
beam_size
=
1
):
"""
...
...
python/paddle/trainer_config_helpers/tests/configs/protostr/test_kmax_seq_socre_layer.protostr
浏览文件 @
b97f020f
type: "nn"
layers {
name: "input"
type: "data"
size: 300
active_type: ""
}
layers {
name: "data"
name: "input_seq"
type: "data"
size: 128
active_type: ""
...
...
@@ -17,7 +11,7 @@ layers {
size: 1
active_type: "exponential"
inputs {
input_layer_name: "
data
"
input_layer_name: "
input_seq
"
input_parameter_name: "___fc_layer_0__.w0"
}
bias_parameter_name: "___fc_layer_0__.wbias"
...
...
@@ -51,15 +45,14 @@ parameters {
initial_strategy: 0
initial_smart: false
}
input_layer_names: "
data
"
input_layer_names: "
input_seq
"
output_layer_names: "__kmax_sequence_score_layer_0__"
sub_models {
name: "root"
layer_names: "input"
layer_names: "data"
layer_names: "input_seq"
layer_names: "__fc_layer_0__"
layer_names: "__kmax_sequence_score_layer_0__"
input_layer_names: "
data
"
input_layer_names: "
input_seq
"
output_layer_names: "__kmax_sequence_score_layer_0__"
is_recurrent_layer_group: false
}
...
...
python/paddle/trainer_config_helpers/tests/configs/test_kmax_seq_socre_layer.py
浏览文件 @
b97f020f
...
...
@@ -2,9 +2,7 @@
#coding=utf-8
from
paddle.trainer_config_helpers
import
*
data
=
data_layer
(
name
=
'input'
,
size
=
300
)
data
=
data_layer
(
name
=
"data"
,
size
=
128
)
data
=
data_layer
(
name
=
"input_seq"
,
size
=
128
)
scores
=
fc_layer
(
input
=
data
,
size
=
1
,
act
=
ExpActivation
())
kmax_seq_id
=
kmax_sequence_score_layer
(
input
=
scores
,
beam_size
=
5
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录