Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
bf69a101
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看板
提交
bf69a101
编写于
11月 10, 2017
作者:
Y
Yibing Liu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Adapt tuning script to padding removing
#444
上级
4913cba5
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
25 addition
and
7 deletion
+25
-7
tools/tune.py
tools/tune.py
+25
-7
未找到文件。
tools/tune.py
浏览文件 @
bf69a101
...
...
@@ -88,7 +88,8 @@ def tune():
augmentation_config
=
'{}'
,
specgram_type
=
args
.
specgram_type
,
num_threads
=
args
.
num_proc_data
,
keep_transcription_text
=
True
)
keep_transcription_text
=
True
,
num_conv_layers
=
args
.
num_conv_layers
)
audio_data
=
paddle
.
layer
.
data
(
name
=
"audio_spectrogram"
,
...
...
@@ -96,10 +97,25 @@ def tune():
text_data
=
paddle
.
layer
.
data
(
name
=
"transcript_text"
,
type
=
paddle
.
data_type
.
integer_value_sequence
(
data_generator
.
vocab_size
))
seq_offset_data
=
paddle
.
layer
.
data
(
name
=
'sequence_offset'
,
type
=
paddle
.
data_type
.
integer_value_sequence
(
1
))
seq_len_data
=
paddle
.
layer
.
data
(
name
=
'sequence_length'
,
type
=
paddle
.
data_type
.
integer_value_sequence
(
1
))
index_range_datas
=
[]
for
i
in
xrange
(
args
.
num_rnn_layers
):
index_range_datas
.
append
(
paddle
.
layer
.
data
(
name
=
'conv%d_index_range'
%
i
,
type
=
paddle
.
data_type
.
dense_vector
(
6
)))
output_probs
,
_
=
deep_speech_v2_network
(
audio_data
=
audio_data
,
text_data
=
text_data
,
seq_offset_data
=
seq_offset_data
,
seq_len_data
=
seq_len_data
,
index_range_datas
=
index_range_datas
,
dict_size
=
data_generator
.
vocab_size
,
num_conv_layers
=
args
.
num_conv_layers
,
num_rnn_layers
=
args
.
num_rnn_layers
,
...
...
@@ -156,15 +172,17 @@ def tune():
for
infer_data
in
batch_reader
():
if
(
args
.
num_batches
>=
0
)
and
(
cur_batch
>=
args
.
num_batches
):
break
infer_results
=
inferer
.
infer
(
input
=
infer_data
)
num_steps
=
len
(
infer_results
)
//
len
(
infer_data
)
infer_results
=
inferer
.
infer
(
input
=
infer_data
,
feeding
=
data_generator
.
feeding
)
start_pos
=
[
0
]
*
(
len
(
infer_data
)
+
1
)
for
i
in
xrange
(
len
(
infer_data
)):
start_pos
[
i
+
1
]
=
start_pos
[
i
]
+
infer_data
[
i
][
3
][
0
]
probs_split
=
[
infer_results
[
i
*
num_steps
:(
i
+
1
)
*
num_steps
]
for
i
in
xrange
(
len
(
infer_data
))
infer_results
[
start_pos
[
i
]:
start_pos
[
i
+
1
]
]
for
i
in
xrange
(
0
,
len
(
infer_data
))
]
target_transcripts
=
[
transcript
for
_
,
transcript
in
infer_data
]
target_transcripts
=
[
data
[
1
]
for
data
in
infer_data
]
num_ins
+=
len
(
target_transcripts
)
# grid search
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录