Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
f18d83f3
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看板
提交
f18d83f3
编写于
6月 08, 2017
作者:
D
dangqingqing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
follow comments
上级
37015fad
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
8 deletion
+16
-8
paddle/function/RowConvOp.cpp
paddle/function/RowConvOp.cpp
+5
-6
paddle/gserver/layers/RowConvLayer.cpp
paddle/gserver/layers/RowConvLayer.cpp
+3
-2
python/paddle/trainer_config_helpers/layers.py
python/paddle/trainer_config_helpers/layers.py
+8
-0
未找到文件。
paddle/function/RowConvOp.cpp
浏览文件 @
f18d83f3
...
...
@@ -136,6 +136,7 @@ public:
// check
CHECK_EQ
(
2UL
,
inputs
.
size
());
CHECK_EQ
(
1UL
,
outputs
.
size
());
// TODO(qingqing): support ASSIGN_TO.
CHECK_EQ
(
outputs
[
0
].
getArgType
(),
ADD_TO
);
CHECK
(
inputs
[
0
].
isSequenceArg
()
&&
outputs
[
0
].
isSequenceArg
())
<<
"SequenceArg required here."
;
...
...
@@ -144,9 +145,7 @@ public:
auto
w
=
inputs
[
1
];
CHECK
(
in
.
data
()
&&
out
.
data
()
&&
in
.
getSequenceId
().
data
());
CHECK_EQ
(
in
.
shape
().
ndims
(),
2UL
);
CHECK_EQ
(
out
.
shape
().
ndims
(),
2UL
);
CHECK_EQ
(
in
.
shape
()[
1
],
out
.
shape
()[
1
]);
CHECK_EQ
(
in
.
shape
()[
0
],
out
.
shape
()[
0
]);
CHECK
(
in
.
shape
()
==
out
.
shape
());
CHECK_EQ
(
w
.
shape
()[
1
],
in
.
shape
()[
1
]);
auto
outMat
=
out
.
matrix
<
Device
>
();
...
...
@@ -176,6 +175,7 @@ public:
template
<
DeviceType
Device
>
class
RowConvGradFunc
:
public
FunctionBase
{
// TODO(qingqing): split into RowConvDataFunc and RowConvWeightFunc
public:
void
init
(
const
FuncConfig
&
config
)
override
{}
...
...
@@ -196,9 +196,8 @@ public:
auto
wGrad
=
outputs
[
1
];
CHECK_EQ
(
in
.
shape
().
ndims
(),
2UL
);
CHECK_EQ
(
outGrad
.
shape
().
ndims
(),
2UL
);
CHECK_EQ
(
in
.
shape
()[
1
],
outGrad
.
shape
()[
1
]);
CHECK_EQ
(
in
.
shape
()[
0
],
outGrad
.
shape
()[
0
]);
CHECK
(
in
.
shape
()
==
inGrad
.
shape
());
CHECK
(
in
.
shape
()
==
outGrad
.
shape
());
CHECK_EQ
(
wGrad
.
shape
()[
1
],
in
.
shape
()[
1
]);
const
auto
outGMat
=
outGrad
.
matrix
<
Device
>
();
...
...
paddle/gserver/layers/RowConvLayer.cpp
浏览文件 @
f18d83f3
...
...
@@ -43,13 +43,14 @@ void RowConvLayer::forward(PassType passType) {
resetOutput
(
height
,
width
);
const
auto
startPos
=
getInput
(
0
).
sequenceStartPositions
->
getVector
(
useGpu_
);
wDims_
=
TensorShape
({
contexLength_
,
width
});
MatrixPtr
w
=
weight_
->
getW
();
wDims_
=
TensorShape
({
w
->
getHeight
(),
w
->
getWidth
()});
MatrixPtr
outV
=
getOutputValue
();
BufferArgs
inputs
;
BufferArgs
outputs
;
inputs
.
addArg
(
*
getInputValue
(
0
),
*
startPos
);
inputs
.
addArg
(
*
w
eight_
->
getW
()
,
wDims_
);
inputs
.
addArg
(
*
w
,
wDims_
);
outputs
.
addArg
(
*
getOutputValue
(),
*
startPos
,
ADD_TO
);
{
...
...
python/paddle/trainer_config_helpers/layers.py
浏览文件 @
f18d83f3
...
...
@@ -191,6 +191,14 @@ class LayerType(object):
PAD_LAYER
=
"pad"
MULTIPLEX_LAYER
=
"multiplex"
ROW_CONV_LAYER
=
"row_conv"
PRINT_LAYER
=
'print'
PRIORBOX_LAYER
=
'priorbox'
CTC_LAYER
=
'ctc'
WARP_CTC_LAYER
=
'warp_ctc'
CRF_LAYER
=
'crf'
CRF_DECODING_LAYER
=
'crf_decoding'
NCE_LAYER
=
'nce'
RANK_COST
=
'rank-cost'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录