Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
2bdcf2c5
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
1 年多 前同步成功
通知
207
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看板
提交
2bdcf2c5
编写于
4月 14, 2021
作者:
H
Hui Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix for train
上级
3e449d65
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
18 addition
and
18 deletion
+18
-18
.pre-commit-config.yaml
.pre-commit-config.yaml
+4
-4
deepspeech/frontend/audio.py
deepspeech/frontend/audio.py
+2
-1
deepspeech/frontend/augmentor/augmentation.py
deepspeech/frontend/augmentor/augmentation.py
+1
-1
deepspeech/frontend/augmentor/base.py
deepspeech/frontend/augmentor/base.py
+2
-2
deepspeech/models/u2.py
deepspeech/models/u2.py
+0
-1
examples/aishell/s1/conf/augmentation.json
examples/aishell/s1/conf/augmentation.json
+2
-2
examples/aishell/s1/conf/conformer.yaml
examples/aishell/s1/conf/conformer.yaml
+4
-4
examples/aishell/s1/local/export.sh
examples/aishell/s1/local/export.sh
+1
-1
examples/aishell/s1/local/test.sh
examples/aishell/s1/local/test.sh
+1
-1
examples/aishell/s1/local/train.sh
examples/aishell/s1/local/train.sh
+1
-1
未找到文件。
.pre-commit-config.yaml
浏览文件 @
2bdcf2c5
...
...
@@ -52,7 +52,7 @@
language
:
system
files
:
\.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto|py)$
#exclude: (?=decoders/swig).*(\.cpp|\.h)$
-
repo
:
https://github.com/asottile/reorder_python_imports
rev
:
v2.4.0
hooks
:
-
id
:
reorder-python-imports
#
- repo: https://github.com/asottile/reorder_python_imports
#
rev: v2.4.0
#
hooks:
#
- id: reorder-python-imports
deepspeech/frontend/audio.py
浏览文件 @
2bdcf2c5
...
...
@@ -330,9 +330,10 @@ class AudioSegment(object):
# new_indices = np.linspace(start=0, stop=old_length, num=new_length)
# self._samples = np.interp(new_indices, old_indices, self._samples)
tfm
=
sox
.
Transformer
()
tfm
.
set_globals
(
multithread
=
False
)
tfm
.
speed
(
speed_rate
)
self
.
_samples
=
tfm
.
build_array
(
input_array
=
self
.
_samples
,
sample_rate_in
=
self
.
_sample_rate
)
input_array
=
self
.
_samples
,
sample_rate_in
=
self
.
_sample_rate
)
.
copy
()
def
normalize
(
self
,
target_db
=-
20
,
max_gain_db
=
300.0
):
"""Normalize audio to be of the desired RMS value in decibels.
...
...
deepspeech/frontend/augmentor/augmentation.py
浏览文件 @
2bdcf2c5
...
...
@@ -113,7 +113,7 @@ class AugmentationPipeline():
Args:
spec_segment (np.ndarray): audio feature, (D, T).
"""
for
augmentor
,
rate
in
zip
(
self
.
_
augmentors
,
self
.
_rates
):
for
augmentor
,
rate
in
zip
(
self
.
_
spec_augmentors
,
self
.
_spec
_rates
):
if
self
.
_rng
.
uniform
(
0.
,
1.
)
<
rate
:
spec_segment
=
augmentor
.
transform_feature
(
spec_segment
)
return
spec_segment
...
...
deepspeech/frontend/augmentor/base.py
浏览文件 @
2bdcf2c5
...
...
@@ -40,7 +40,7 @@ class AugmentorBase():
:param audio_segment: Audio segment to add effects to.
:type audio_segment: AudioSegmenet|SpeechSegment
"""
pass
raise
NotImplementedError
@
abstractmethod
def
transform_feature
(
self
,
spec_segment
):
...
...
@@ -52,4 +52,4 @@ class AugmentorBase():
Args:
spec_segment (Spectrogram): Spectrogram segment to add effects to.
"""
pass
raise
NotImplementedError
deepspeech/models/u2.py
浏览文件 @
2bdcf2c5
...
...
@@ -133,7 +133,6 @@ class U2BaseModel(nn.Module):
smoothing
=
lsm_weight
,
normalize_length
=
length_normalized_loss
,
)
@
jit
.
export
def
forward
(
self
,
speech
:
paddle
.
Tensor
,
...
...
examples/aishell/s1/conf/augmentation.json
浏览文件 @
2bdcf2c5
...
...
@@ -6,7 +6,7 @@
"max_speed_rate"
:
1.1
,
"num_rates"
:
3
},
"prob"
:
1
.0
"prob"
:
0
.0
},
{
"type"
:
"shift"
,
...
...
@@ -29,6 +29,6 @@
"adaptive_size_ratio"
:
0
,
"max_n_time_masks"
:
20
},
"prob"
:
0
.0
"prob"
:
1
.0
}
]
examples/aishell/s1/conf/conformer.yaml
浏览文件 @
2bdcf2c5
...
...
@@ -8,11 +8,11 @@ data:
spm_model_prefix
:
'
'
mean_std_filepath
:
"
"
augmentation_config
:
conf/augmentation.json
batch_size
:
16
batch_size
:
64
min_input_len
:
0.5
max_input_len
:
20.0
min_output_len
:
0.0
max_output_len
:
400
max_output_len
:
400
.0
min_output_input_ratio
:
0.05
max_output_input_ratio
:
10.0
raw_wav
:
True
# use raw_wav or kaldi feature
...
...
@@ -75,7 +75,7 @@ model:
training
:
n_epoch
:
240
accum_grad
:
4
accum_grad
:
1
global_grad_clip
:
5.0
optim
:
adam
optim_conf
:
...
...
@@ -85,7 +85,7 @@ training:
scheduler_conf
:
warmup_steps
:
25000
lr_decay
:
1.0
log_interval
:
1
00
log_interval
:
1
decoding
:
...
...
examples/aishell/s1/local/export.sh
浏览文件 @
2bdcf2c5
...
...
@@ -6,7 +6,7 @@ if [ $# != 2 ];then
fi
python3
-u
${
BIN_DIR
}
/export.py
\
--config
conf/
deepspeech2
.yaml
\
--config
conf/
conformer
.yaml
\
--checkpoint_path
${
1
}
\
--export_path
${
2
}
...
...
examples/aishell/s1/local/test.sh
浏览文件 @
2bdcf2c5
...
...
@@ -9,7 +9,7 @@ fi
python3
-u
${
BIN_DIR
}
/test.py
\
--device
'gpu'
\
--nproc
1
\
--config
conf/
deepspeech2
.yaml
\
--config
conf/
conformer
.yaml
\
--output
ckpt
if
[
$?
-ne
0
]
;
then
...
...
examples/aishell/s1/local/train.sh
浏览文件 @
2bdcf2c5
...
...
@@ -6,7 +6,7 @@ echo "using $ngpu gpus..."
python3
-u
${
BIN_DIR
}
/train.py
\
--device
'gpu'
\
--nproc
${
ngpu
}
\
--config
conf/
deepspeech2
.yaml
\
--config
conf/
conformer
.yaml
\
--output
ckpt-
${
1
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录