Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
123c1a4f
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看板
提交
123c1a4f
编写于
10月 09, 2021
作者:
H
Hui Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
format
上级
17092cbb
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
24 addition
and
15 deletion
+24
-15
deepspeech/exps/deepspeech2/model.py
deepspeech/exps/deepspeech2/model.py
+4
-2
deepspeech/exps/u2/model.py
deepspeech/exps/u2/model.py
+4
-2
deepspeech/frontend/augmentor/augmentation.py
deepspeech/frontend/augmentor/augmentation.py
+4
-3
deepspeech/frontend/featurizer/text_featurizer.py
deepspeech/frontend/featurizer/text_featurizer.py
+6
-6
deepspeech/io/collator.py
deepspeech/io/collator.py
+1
-1
deepspeech/modules/loss.py
deepspeech/modules/loss.py
+5
-1
未找到文件。
deepspeech/exps/deepspeech2/model.py
浏览文件 @
123c1a4f
...
@@ -187,7 +187,8 @@ class DeepSpeech2Trainer(Trainer):
...
@@ -187,7 +187,8 @@ class DeepSpeech2Trainer(Trainer):
sortagrad
=
config
.
data
.
sortagrad
,
sortagrad
=
config
.
data
.
sortagrad
,
shuffle_method
=
config
.
data
.
shuffle_method
)
shuffle_method
=
config
.
data
.
shuffle_method
)
collate_fn
=
SpeechCollator
(
keep_transcription_text
=
False
,
return_utts
=
False
)
collate_fn
=
SpeechCollator
(
keep_transcription_text
=
False
,
return_utts
=
False
)
self
.
train_loader
=
DataLoader
(
self
.
train_loader
=
DataLoader
(
train_dataset
,
train_dataset
,
batch_sampler
=
batch_sampler
,
batch_sampler
=
batch_sampler
,
...
@@ -220,7 +221,8 @@ class DeepSpeech2Trainer(Trainer):
...
@@ -220,7 +221,8 @@ class DeepSpeech2Trainer(Trainer):
batch_size
=
config
.
decoding
.
batch_size
,
batch_size
=
config
.
decoding
.
batch_size
,
shuffle
=
False
,
shuffle
=
False
,
drop_last
=
False
,
drop_last
=
False
,
collate_fn
=
SpeechCollator
(
keep_transcription_text
=
True
,
return_utts
=
True
))
collate_fn
=
SpeechCollator
(
keep_transcription_text
=
True
,
return_utts
=
True
))
logger
.
info
(
"Setup test Dataloader!"
)
logger
.
info
(
"Setup test Dataloader!"
)
...
...
deepspeech/exps/u2/model.py
浏览文件 @
123c1a4f
...
@@ -222,7 +222,8 @@ class U2Trainer(Trainer):
...
@@ -222,7 +222,8 @@ class U2Trainer(Trainer):
config
.
data
.
augmentation_config
=
""
config
.
data
.
augmentation_config
=
""
dev_dataset
=
ManifestDataset
.
from_config
(
config
)
dev_dataset
=
ManifestDataset
.
from_config
(
config
)
collate_fn
=
SpeechCollator
(
keep_transcription_text
=
False
,
return_utts
=
False
)
collate_fn
=
SpeechCollator
(
keep_transcription_text
=
False
,
return_utts
=
False
)
if
self
.
parallel
:
if
self
.
parallel
:
batch_sampler
=
SortagradDistributedBatchSampler
(
batch_sampler
=
SortagradDistributedBatchSampler
(
train_dataset
,
train_dataset
,
...
@@ -272,7 +273,8 @@ class U2Trainer(Trainer):
...
@@ -272,7 +273,8 @@ class U2Trainer(Trainer):
batch_size
=
config
.
decoding
.
batch_size
,
batch_size
=
config
.
decoding
.
batch_size
,
shuffle
=
False
,
shuffle
=
False
,
drop_last
=
False
,
drop_last
=
False
,
collate_fn
=
SpeechCollator
(
keep_transcription_text
=
True
,
return_utts
=
True
))
collate_fn
=
SpeechCollator
(
keep_transcription_text
=
True
,
return_utts
=
True
))
logger
.
info
(
"Setup train/valid/test Dataloader!"
)
logger
.
info
(
"Setup train/valid/test Dataloader!"
)
def
setup_model
(
self
):
def
setup_model
(
self
):
...
...
deepspeech/frontend/augmentor/augmentation.py
浏览文件 @
123c1a4f
...
@@ -13,9 +13,9 @@
...
@@ -13,9 +13,9 @@
# limitations under the License.
# limitations under the License.
"""Contains the data augmentation pipeline."""
"""Contains the data augmentation pipeline."""
import
json
import
json
from
pprint
import
pformat
from
collections.abc
import
Sequence
from
collections.abc
import
Sequence
from
inspect
import
signature
from
inspect
import
signature
from
pprint
import
pformat
import
numpy
as
np
import
numpy
as
np
...
@@ -112,7 +112,8 @@ class AugmentationPipeline():
...
@@ -112,7 +112,8 @@ class AugmentationPipeline():
'audio'
)
'audio'
)
self
.
_spec_augmentors
,
self
.
_spec_rates
=
self
.
_parse_pipeline_from
(
self
.
_spec_augmentors
,
self
.
_spec_rates
=
self
.
_parse_pipeline_from
(
'feature'
)
'feature'
)
logger
.
info
(
f
"Augmentation:
{
pformat
(
list
(
zip
(
self
.
_augmentors
,
self
.
_rates
)))
}
"
)
logger
.
info
(
f
"Augmentation:
{
pformat
(
list
(
zip
(
self
.
_augmentors
,
self
.
_rates
)))
}
"
)
def
__call__
(
self
,
xs
,
uttid_list
=
None
,
**
kwargs
):
def
__call__
(
self
,
xs
,
uttid_list
=
None
,
**
kwargs
):
if
not
isinstance
(
xs
,
Sequence
):
if
not
isinstance
(
xs
,
Sequence
):
...
...
deepspeech/frontend/featurizer/text_featurizer.py
浏览文件 @
123c1a4f
...
@@ -12,17 +12,17 @@
...
@@ -12,17 +12,17 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
"""Contains the text featurizer class."""
"""Contains the text featurizer class."""
import
sentencepiece
as
spm
from
pprint
import
pformat
from
pprint
import
pformat
import
sentencepiece
as
spm
from
..utility
import
BLANK
from
..utility
import
EOS
from
..utility
import
EOS
from
..utility
import
load_dict
from
..utility
import
MASKCTC
from
..utility
import
SOS
from
..utility
import
SPACE
from
..utility
import
SPACE
from
..utility
import
UNK
from
..utility
import
UNK
from
..utility
import
SOS
from
..utility
import
BLANK
from
..utility
import
MASKCTC
from
..utility
import
load_dict
from
deepspeech.utils.log
import
Log
from
deepspeech.utils.log
import
Log
logger
=
Log
(
__name__
).
getlog
()
logger
=
Log
(
__name__
).
getlog
()
...
...
deepspeech/io/collator.py
浏览文件 @
123c1a4f
deepspeech/modules/loss.py
浏览文件 @
123c1a4f
...
@@ -23,7 +23,11 @@ __all__ = ['CTCLoss', "LabelSmoothingLoss"]
...
@@ -23,7 +23,11 @@ __all__ = ['CTCLoss', "LabelSmoothingLoss"]
class
CTCLoss
(
nn
.
Layer
):
class
CTCLoss
(
nn
.
Layer
):
def
__init__
(
self
,
blank
=
0
,
reduction
=
'sum'
,
batch_average
=
False
,
grad_norm_type
=
None
):
def
__init__
(
self
,
blank
=
0
,
reduction
=
'sum'
,
batch_average
=
False
,
grad_norm_type
=
None
):
super
().
__init__
()
super
().
__init__
()
# last token id as blank id
# last token id as blank id
self
.
loss
=
nn
.
CTCLoss
(
blank
=
blank
,
reduction
=
reduction
)
self
.
loss
=
nn
.
CTCLoss
(
blank
=
blank
,
reduction
=
reduction
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录