summaryrefslogtreecommitdiff
path: root/speech_utils
diff options
context:
space:
mode:
authorYimmon Zhuang <[email protected]>2015-08-14 16:51:26 +0800
committerYimmon Zhuang <[email protected]>2015-08-14 16:51:26 +0800
commit4a3308c3f6b0c7d557e9108832102d57dcc63f8e (patch)
tree01230810539801781c99d862f4c5884acd009bdb /speech_utils
parent09cb9dbf24be26ef064b3844a5a4b7ced8c8b02b (diff)
solve dependencies
Diffstat (limited to 'speech_utils')
-rw-r--r--speech_utils/init.lua15
1 files changed, 10 insertions, 5 deletions
diff --git a/speech_utils/init.lua b/speech_utils/init.lua
index 3d1a470..3500eb4 100644
--- a/speech_utils/init.lua
+++ b/speech_utils/init.lua
@@ -1,6 +1,7 @@
nerv.speech_utils = {}
-function nerv.speech_utils.global_transf(feat_utter, global_transf, frm_ext, gconf)
+function nerv.speech_utils.global_transf(feat_utter, global_transf,
+ frm_ext, frm_trim, gconf)
local rearranged
feat_utter = gconf.cumat_type.new_from_host(feat_utter)
if frm_ext > 0 then
@@ -9,8 +10,12 @@ function nerv.speech_utils.global_transf(feat_utter, global_transf, frm_ext, gco
local expanded = gconf.cumat_type(feat_utter:nrow(), feat_utter:ncol() * step)
expanded:expand_frm(feat_utter, frm_ext)
-- rearrange the feature (``transpose'' operation in TNet)
- rearranged = expanded:create()
- rearranged:rearrange_frm(expanded, step)
+ if gconf.rearrange then
+ rearranged = expanded:create()
+ rearranged:rearrange_frm(expanded, step)
+ else
+ rearranged = expanded
+ end
else
rearranged = feat_utter
end
@@ -21,8 +26,8 @@ function nerv.speech_utils.global_transf(feat_utter, global_transf, frm_ext, gco
global_transf:init(input[1]:nrow())
global_transf:propagate(input, output)
-- trim frames
- expanded = gconf.mmat_type(output[1]:nrow() - frm_ext * 2, output[1]:ncol())
- output[1]:copy_toh(expanded, frm_ext, feat_utter:nrow() - frm_ext)
+ expanded = gconf.mmat_type(output[1]:nrow() - frm_trim * 2, output[1]:ncol())
+ output[1]:copy_toh(expanded, frm_trim, feat_utter:nrow() - frm_trim)
collectgarbage("collect")
return expanded
end