Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
7d133368
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
大约 1 年 前同步成功
通知
206
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7d133368
编写于
8月 17, 2021
作者:
H
Hui Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bugs
上级
16f4bdc5
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
19 addition
and
31 deletion
+19
-31
.bashrc
.bashrc
+0
-10
.notebook/u2_confermer_model_wenet.ipynb
.notebook/u2_confermer_model_wenet.ipynb
+1
-1
deepspeech/frontend/augmentor/augmentation.py
deepspeech/frontend/augmentor/augmentation.py
+1
-4
deepspeech/io/dataset.py
deepspeech/io/dataset.py
+1
-0
deepspeech/models/ds2/rnn.py
deepspeech/models/ds2/rnn.py
+1
-1
deepspeech/models/u2.py
deepspeech/models/u2.py
+1
-1
deepspeech/models/u2_st.py
deepspeech/models/u2_st.py
+1
-1
deepspeech/modules/decoder.py
deepspeech/modules/decoder.py
+2
-2
deepspeech/modules/decoder_layer.py
deepspeech/modules/decoder_layer.py
+7
-7
deepspeech/modules/encoder.py
deepspeech/modules/encoder.py
+2
-2
deepspeech/modules/rnn.py
deepspeech/modules/rnn.py
+1
-1
examples/librispeech/s0/conf/deepspeech2.yaml
examples/librispeech/s0/conf/deepspeech2.yaml
+1
-1
未找到文件。
.bashrc
已删除
100755 → 0
浏览文件 @
16f4bdc5
# Locales
export
LC_ALL
=
en_US.UTF-8
export
LANG
=
en_US.UTF-8
export
LANGUAGE
=
en_US.UTF-8
# Aliases
alias
nvs
=
"nvidia-smi"
alias
rsync
=
"rsync --progress -raz"
alias
his
=
"history"
.notebook/u2_confermer_model_wenet.ipynb
浏览文件 @
7d133368
...
...
@@ -3431,7 +3431,7 @@
" convolution_layer_args = (output_size, cnn_module_kernel, activation,\n",
" cnn_module_norm, causal)\n",
"\n",
" self.encoders = nn.
Module
List([\n",
" self.encoders = nn.
Layer
List([\n",
" ConformerEncoderLayer(\n",
" size=output_size,\n",
" self_attn=encoder_selfattn_layer(*encoder_selfattn_layer_args),\n",
...
...
deepspeech/frontend/augmentor/augmentation.py
浏览文件 @
7d133368
...
...
@@ -164,8 +164,6 @@ class AugmentationPipeline():
:param audio_segment: Audio segment to process.
:type audio_segment: AudioSegmenet|SpeechSegment
"""
if
not
self
.
_train
:
return
for
augmentor
,
rate
in
zip
(
self
.
_audio_augmentors
,
self
.
_audio_rates
):
if
self
.
_rng
.
uniform
(
0.
,
1.
)
<
rate
:
augmentor
.
transform_audio
(
audio_segment
)
...
...
@@ -176,8 +174,6 @@ class AugmentationPipeline():
Args:
spec_segment (np.ndarray): audio feature, (D, T).
"""
if
not
self
.
_train
:
return
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
)
...
...
@@ -217,3 +213,4 @@ class AugmentationPipeline():
obj
=
class_obj
(
self
.
_rng
,
**
params
)
except
Exception
:
raise
ValueError
(
"Unknown augmentor type [%s]."
%
augmentor_type
)
return
obj
deepspeech/io/dataset.py
浏览文件 @
7d133368
...
...
@@ -13,6 +13,7 @@
# limitations under the License.
from
typing
import
Optional
import
numpy
as
np
from
paddle.io
import
Dataset
from
yacs.config
import
CfgNode
...
...
deepspeech/models/ds2/rnn.py
浏览文件 @
7d133368
...
...
@@ -297,7 +297,7 @@ class RNNStack(nn.Layer):
share_weights
=
share_rnn_weights
))
i_size
=
h_size
*
2
self
.
rnn_stacks
=
nn
.
Module
List
(
rnn_stacks
)
self
.
rnn_stacks
=
nn
.
Layer
List
(
rnn_stacks
)
def
forward
(
self
,
x
:
paddle
.
Tensor
,
x_len
:
paddle
.
Tensor
):
"""
...
...
deepspeech/models/u2.py
浏览文件 @
7d133368
...
...
@@ -54,7 +54,7 @@ __all__ = ["U2Model", "U2InferModel"]
logger
=
Log
(
__name__
).
getlog
()
class
U2BaseModel
(
nn
.
Module
):
class
U2BaseModel
(
nn
.
Layer
):
"""CTC-Attention hybrid Encoder-Decoder model"""
@
classmethod
...
...
deepspeech/models/u2_st.py
浏览文件 @
7d133368
...
...
@@ -48,7 +48,7 @@ __all__ = ["U2STModel", "U2STInferModel"]
logger
=
Log
(
__name__
).
getlog
()
class
U2STBaseModel
(
nn
.
Module
):
class
U2STBaseModel
(
nn
.
Layer
):
"""CTC-Attention hybrid Encoder-Decoder model"""
@
classmethod
...
...
deepspeech/modules/decoder.py
浏览文件 @
7d133368
...
...
@@ -33,7 +33,7 @@ logger = Log(__name__).getlog()
__all__
=
[
"TransformerDecoder"
]
class
TransformerDecoder
(
nn
.
Module
):
class
TransformerDecoder
(
nn
.
Layer
):
"""Base class of Transfomer decoder module.
Args:
vocab_size: output dim
...
...
@@ -86,7 +86,7 @@ class TransformerDecoder(nn.Module):
self
.
use_output_layer
=
use_output_layer
self
.
output_layer
=
nn
.
Linear
(
attention_dim
,
vocab_size
)
self
.
decoders
=
nn
.
Module
List
([
self
.
decoders
=
nn
.
Layer
List
([
DecoderLayer
(
size
=
attention_dim
,
self_attn
=
MultiHeadedAttention
(
attention_heads
,
attention_dim
,
...
...
deepspeech/modules/decoder_layer.py
浏览文件 @
7d133368
...
...
@@ -25,15 +25,15 @@ logger = Log(__name__).getlog()
__all__
=
[
"DecoderLayer"
]
class
DecoderLayer
(
nn
.
Module
):
class
DecoderLayer
(
nn
.
Layer
):
"""Single decoder layer module.
Args:
size (int): Input dimension.
self_attn (nn.
Module
): Self-attention module instance.
self_attn (nn.
Layer
): Self-attention module instance.
`MultiHeadedAttention` instance can be used as the argument.
src_attn (nn.
Module
): Self-attention module instance.
src_attn (nn.
Layer
): Self-attention module instance.
`MultiHeadedAttention` instance can be used as the argument.
feed_forward (nn.
Module
): Feed-forward module instance.
feed_forward (nn.
Layer
): Feed-forward module instance.
`PositionwiseFeedForward` instance can be used as the argument.
dropout_rate (float): Dropout rate.
normalize_before (bool):
...
...
@@ -48,9 +48,9 @@ class DecoderLayer(nn.Module):
def
__init__
(
self
,
size
:
int
,
self_attn
:
nn
.
Module
,
src_attn
:
nn
.
Module
,
feed_forward
:
nn
.
Module
,
self_attn
:
nn
.
Layer
,
src_attn
:
nn
.
Layer
,
feed_forward
:
nn
.
Layer
,
dropout_rate
:
float
,
normalize_before
:
bool
=
True
,
concat_after
:
bool
=
False
,
):
...
...
deepspeech/modules/encoder.py
浏览文件 @
7d133368
...
...
@@ -358,7 +358,7 @@ class TransformerEncoder(BaseEncoder):
pos_enc_layer_type
,
normalize_before
,
concat_after
,
static_chunk_size
,
use_dynamic_chunk
,
global_cmvn
,
use_dynamic_left_chunk
)
self
.
encoders
=
nn
.
Module
List
([
self
.
encoders
=
nn
.
Layer
List
([
TransformerEncoderLayer
(
size
=
output_size
,
self_attn
=
MultiHeadedAttention
(
attention_heads
,
output_size
,
...
...
@@ -438,7 +438,7 @@ class ConformerEncoder(BaseEncoder):
convolution_layer_args
=
(
output_size
,
cnn_module_kernel
,
activation
,
cnn_module_norm
,
causal
)
self
.
encoders
=
nn
.
Module
List
([
self
.
encoders
=
nn
.
Layer
List
([
ConformerEncoderLayer
(
size
=
output_size
,
self_attn
=
encoder_selfattn_layer
(
*
encoder_selfattn_layer_args
),
...
...
deepspeech/modules/rnn.py
浏览文件 @
7d133368
...
...
@@ -297,7 +297,7 @@ class RNNStack(nn.Layer):
share_weights
=
share_rnn_weights
))
i_size
=
h_size
*
2
self
.
rnn_stacks
=
nn
.
Module
List
(
rnn_stacks
)
self
.
rnn_stacks
=
nn
.
Layer
List
(
rnn_stacks
)
def
forward
(
self
,
x
:
paddle
.
Tensor
,
x_len
:
paddle
.
Tensor
):
"""
...
...
examples/librispeech/s0/conf/deepspeech2.yaml
浏览文件 @
7d133368
...
...
@@ -32,7 +32,7 @@ collator:
keep_transcription_text
:
False
sortagrad
:
True
shuffle_method
:
batch_shuffle
num_workers
:
0
num_workers
:
2
model
:
num_conv_layers
:
2
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录