diff options
Diffstat (limited to 'nerv/layer')
-rw-r--r-- | nerv/layer/affine_recurrent.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nerv/layer/affine_recurrent.lua b/nerv/layer/affine_recurrent.lua index 3d448d3..c8cd382 100644 --- a/nerv/layer/affine_recurrent.lua +++ b/nerv/layer/affine_recurrent.lua @@ -54,8 +54,8 @@ function Recurrent:update(bp_err, input, output) self.ltp_hh.correction:mul(input[2], bp_err[1], 1.0, gconf.momentum, 'T', 'N') self.bp.correction:add(self.bp.correction, bp_err[1]:colsum(), gconf.momentum, 1.0) -- perform update and weight decay - ltp_hh:add(ltp_hh, self.ltp_hh.correction, 1.0 - gconf.lrate.gconf.wcost/n, -gconf.lrate / n) - bp:add(bp, self.bp.correction, 1.0 - gconf.lrate*gconf.wcost/n, -gconf.lrate / n) + ltp_hh:add(ltp_hh, self.ltp_hh.correction, 1.0-gconf.lrate*gconf.wcost/gconf.batch_size, -gconf.lrate/n) + bp:add(bp, self.bp.correction, 1.0-gconf.lrate*gconf.wcost/gconf.batch_size, -gconf.lrate/n) else ltp_hh:mul(input[2], bp_err[1], -gconf.lrate/gconf.batch_size, 1.0-gconf.wcost*gconf.lrate/gconf.batch_size, 'T', 'N') bp:add(bp, bp_err[1]:colsum(), 1.0-gconf.lrate*gconf.wcost/gconf.batch_size, -gconf.lrate/gconf.batch_size) |