Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
35bc7170
M
models
项目概览
PaddlePaddle
/
models
大约 1 年 前同步成功
通知
222
Star
6828
Fork
2962
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
602
列表
看板
标记
里程碑
合并请求
255
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
models
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
602
Issue
602
列表
看板
标记
里程碑
合并请求
255
合并请求
255
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
35bc7170
编写于
9月 03, 2017
作者:
X
Xinghai Sun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed a bug of mixing forward and backward projection in bi-directional GRUs.
上级
9d09fced
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
12 addition
and
5 deletion
+12
-5
deep_speech_2/layer.py
deep_speech_2/layer.py
+12
-5
未找到文件。
deep_speech_2/layer.py
浏览文件 @
35bc7170
...
@@ -84,19 +84,26 @@ def bidirectional_gru_bn_layer(name, input, size, act):
...
@@ -84,19 +84,26 @@ def bidirectional_gru_bn_layer(name, input, size, act):
:rtype: LayerOutput
:rtype: LayerOutput
"""
"""
# input-hidden weights shared across bi-direcitonal rnn.
# input-hidden weights shared across bi-direcitonal rnn.
input_proj
=
paddle
.
layer
.
fc
(
input_proj_forward
=
paddle
.
layer
.
fc
(
input
=
input
,
size
=
size
*
3
,
act
=
paddle
.
activation
.
Linear
(),
bias_attr
=
False
)
input_proj_backward
=
paddle
.
layer
.
fc
(
input
=
input
,
input
=
input
,
size
=
size
*
3
,
size
=
size
*
3
,
act
=
paddle
.
activation
.
Linear
(),
act
=
paddle
.
activation
.
Linear
(),
bias_attr
=
False
)
bias_attr
=
False
)
# batch norm is only performed on input-state projection
# batch norm is only performed on input-state projection
input_proj_bn
=
paddle
.
layer
.
batch_norm
(
input_proj_bn_forward
=
paddle
.
layer
.
batch_norm
(
input
=
input_proj
,
act
=
paddle
.
activation
.
Linear
())
input
=
input_proj_forward
,
act
=
paddle
.
activation
.
Linear
())
input_proj_bn_backward
=
paddle
.
layer
.
batch_norm
(
input
=
input_proj_backward
,
act
=
paddle
.
activation
.
Linear
())
# forward and backward in time
# forward and backward in time
forward_gru
=
paddle
.
layer
.
grumemory
(
forward_gru
=
paddle
.
layer
.
grumemory
(
input
=
input_proj_bn
,
act
=
act
,
reverse
=
False
)
input
=
input_proj_bn
_forward
,
act
=
act
,
reverse
=
False
)
backward_gru
=
paddle
.
layer
.
grumemory
(
backward_gru
=
paddle
.
layer
.
grumemory
(
input
=
input_proj_bn
,
act
=
act
,
reverse
=
True
)
input
=
input_proj_bn
_backward
,
act
=
act
,
reverse
=
True
)
return
paddle
.
layer
.
concat
(
input
=
[
forward_gru
,
backward_gru
])
return
paddle
.
layer
.
concat
(
input
=
[
forward_gru
,
backward_gru
])
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录