summaryrefslogtreecommitdiff
path: root/speech_utils/init.lua
diff options
context:
space:
mode:
authorYimmon Zhuang <[email protected]>2015-08-26 15:04:05 +0800
committerYimmon Zhuang <[email protected]>2015-08-26 15:04:05 +0800
commit76d64a91f72a19221e7ff9461860b214cbff216f (patch)
treef8bbf650dd2c54c3b3e0797e488723825f171dcb /speech_utils/init.lua
parent5c90a652862c464b5bfe2e5777ff20ae25beb4a0 (diff)
parent6495879e76dc0a2efe7b214b58d1d73a4ed3a931 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'speech_utils/init.lua')
-rw-r--r--speech_utils/init.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/speech_utils/init.lua b/speech_utils/init.lua
index 3500eb4..7d5651f 100644
--- a/speech_utils/init.lua
+++ b/speech_utils/init.lua
@@ -3,8 +3,8 @@ nerv.speech_utils = {}
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
+-- feat_utter = gconf.cumat_type.new_from_host(feat_utter)
+ if frm_ext ~= nil and frm_ext > 0 then
local step = frm_ext * 2 + 1
-- expand the feature
local expanded = gconf.cumat_type(feat_utter:nrow(), feat_utter:ncol() * step)
@@ -26,8 +26,8 @@ function nerv.speech_utils.global_transf(feat_utter, global_transf,
global_transf:init(input[1]:nrow())
global_transf:propagate(input, output)
-- trim frames
- 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)
+ expanded = gconf.cumat_type(output[1]:nrow() - frm_trim * 2, output[1]:ncol())
+ expanded:copy_fromd(output[1], frm_trim, feat_utter:nrow() - frm_trim)
collectgarbage("collect")
return expanded
end