Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
77e44ab3
M
models
项目概览
PaddlePaddle
/
models
大约 1 年 前同步成功
通知
222
Star
6828
Fork
2962
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
602
列表
看板
标记
里程碑
合并请求
255
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
models
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
602
Issue
602
列表
看板
标记
里程碑
合并请求
255
合并请求
255
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
77e44ab3
编写于
2月 06, 2018
作者:
Z
zhxfl
提交者:
GitHub
2月 06, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #640 from zhxfl/fix-639
Augmentation should compute frame_dim
上级
b1c37965
000f6855
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
17 deletion
+13
-17
fluid/DeepASR/data_utils/data_reader.py
fluid/DeepASR/data_utils/data_reader.py
+13
-17
未找到文件。
fluid/DeepASR/data_utils/data_reader.py
浏览文件 @
77e44ab3
...
...
@@ -121,8 +121,6 @@ class DataReader(object):
corresponding description file.
label_file_list (str): File containing paths of label data file and
corresponding description file.
frame_dim (int): The final feature dimension of one frame after all
augmentation applied.
drop_frame_len (int): Samples whose label length above the value will be
dropped.
process_num (int): Number of processes for processing data.
...
...
@@ -137,21 +135,18 @@ class DataReader(object):
random_seed (int): Random seed.
"""
def
__init__
(
self
,
feature_file_list
,
label_file_list
,
frame_dim
=
120
*
11
,
# @TODO augmentor is responsible for the value
drop_frame_len
=
512
,
process_num
=
10
,
sample_buffer_size
=
1024
,
sample_info_buffer_size
=
1024
,
batch_buffer_size
=
1024
,
shuffle_block_num
=
1
,
random_seed
=
0
):
def
__init__
(
self
,
feature_file_list
,
label_file_list
,
drop_frame_len
=
512
,
process_num
=
10
,
sample_buffer_size
=
1024
,
sample_info_buffer_size
=
1024
,
batch_buffer_size
=
1024
,
shuffle_block_num
=
1
,
random_seed
=
0
):
self
.
_feature_file_list
=
feature_file_list
self
.
_label_file_list
=
label_file_list
self
.
_frame_dim
=
frame_dim
self
.
_drop_frame_len
=
drop_frame_len
self
.
_shuffle_block_num
=
shuffle_block_num
self
.
_block_info_list
=
None
...
...
@@ -300,8 +295,9 @@ class DataReader(object):
def
batch_iterator
(
self
,
batch_size
,
minimum_batch_size
):
def
batch_to_ndarray
(
batch_samples
,
lod
):
batch_feature
=
np
.
zeros
(
(
lod
[
-
1
],
self
.
_frame_dim
),
dtype
=
"float32"
)
assert
len
(
batch_samples
)
frame_dim
=
batch_samples
[
0
][
0
].
shape
[
1
]
batch_feature
=
np
.
zeros
((
lod
[
-
1
],
frame_dim
),
dtype
=
"float32"
)
batch_label
=
np
.
zeros
((
lod
[
-
1
],
1
),
dtype
=
"int64"
)
start
=
0
for
sample
in
batch_samples
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录