aboutsummaryrefslogtreecommitdiff
path: root/nerv/layer/softmax_ce.lua
diff options
context:
space:
mode:
authorYimmon Zhuang <yimmon.zhuang@gmail.com>2015-09-18 22:17:25 +0800
committerYimmon Zhuang <yimmon.zhuang@gmail.com>2015-09-18 22:17:25 +0800
commit37286a08b40f68b544983d8dde4a77ac0b488397 (patch)
treecc5512ef1c5e9eab3a2f1ba7c6d064a92079dafc /nerv/layer/softmax_ce.lua
parent5b99c28961ca223cc35e77a4482eb789d5bef06d (diff)
kaldi mpe training support
Diffstat (limited to 'nerv/layer/softmax_ce.lua')
-rw-r--r--nerv/layer/softmax_ce.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/nerv/layer/softmax_ce.lua b/nerv/layer/softmax_ce.lua
index f878a2f..9071e86 100644
--- a/nerv/layer/softmax_ce.lua
+++ b/nerv/layer/softmax_ce.lua
@@ -23,6 +23,13 @@ function SoftmaxCELayer:init(batch_size)
self.ce = self.softmax:create()
end
+function SoftmaxCELayer:batch_resize(batch_size)
+ if self.softmax:nrow() ~= batch_resize then
+ self.softmax = self.gconf.cumat_type(batch_size, self.dim_in[1])
+ self.ce = self.softmax:create()
+ end
+end
+
function SoftmaxCELayer:update(bp_err, input, output)
-- no params, therefore do nothing
end