Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
0c089152
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
大约 2 年 前同步成功
通知
210
Star
8425
Fork
1598
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
245
列表
看板
标记
里程碑
合并请求
3
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
DeepSpeech
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
245
Issue
245
列表
看板
标记
里程碑
合并请求
3
合并请求
3
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0c089152
编写于
9月 26, 2021
作者:
H
Hui Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ctc using nn.Dropout; ds2 libri vald batch_size / 4
上级
156a8402
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
5 addition
and
5 deletion
+5
-5
deepspeech/exps/deepspeech2/model.py
deepspeech/exps/deepspeech2/model.py
+1
-1
deepspeech/modules/ctc.py
deepspeech/modules/ctc.py
+2
-2
deepspeech/modules/loss.py
deepspeech/modules/loss.py
+2
-2
未找到文件。
deepspeech/exps/deepspeech2/model.py
浏览文件 @
0c089152
...
...
@@ -235,7 +235,7 @@ class DeepSpeech2Trainer(Trainer):
num_workers
=
config
.
collator
.
num_workers
)
self
.
valid_loader
=
DataLoader
(
dev_dataset
,
batch_size
=
config
.
collator
.
batch_size
,
batch_size
=
int
(
config
.
collator
.
batch_size
/
4
)
,
shuffle
=
False
,
drop_last
=
False
,
collate_fn
=
collate_fn_dev
)
...
...
deepspeech/modules/ctc.py
浏览文件 @
0c089152
...
...
@@ -56,7 +56,7 @@ class CTCDecoder(nn.Layer):
self
.
blank_id
=
blank_id
self
.
odim
=
odim
self
.
dropout
_rate
=
dropout_rate
self
.
dropout
=
nn
.
Dropout
(
dropout_rate
)
self
.
ctc_lo
=
nn
.
Linear
(
enc_n_units
,
self
.
odim
)
reduction_type
=
"sum"
if
reduction
else
"none"
self
.
criterion
=
CTCLoss
(
...
...
@@ -79,7 +79,7 @@ class CTCDecoder(nn.Layer):
Returns:
loss (Tenosr): ctc loss value, scalar.
"""
logits
=
self
.
ctc_lo
(
F
.
dropout
(
hs_pad
,
p
=
self
.
dropout_rate
))
logits
=
self
.
ctc_lo
(
self
.
dropout
(
hs_pad
))
loss
=
self
.
criterion
(
logits
,
ys_pad
,
hlens
,
ys_lens
)
return
loss
...
...
deepspeech/modules/loss.py
浏览文件 @
0c089152
...
...
@@ -45,9 +45,9 @@ class CTCLoss(nn.Layer):
logger
.
info
(
f
"CTCLoss Grad Norm Type:
{
grad_norm_type
}
"
)
if
grad_norm_type
==
'instance'
:
self
.
norm_by_times
=
True
if
grad_norm_type
==
'batch'
:
el
if
grad_norm_type
==
'batch'
:
self
.
norm_by_batchsize
=
True
if
grad_norm_type
==
'frame'
:
el
if
grad_norm_type
==
'frame'
:
self
.
norm_by_total_logits_len
=
True
def
forward
(
self
,
logits
,
ys_pad
,
hlens
,
ys_lens
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录