aboutsummaryrefslogtreecommitdiff
path: root/nerv/layer
diff options
context:
space:
mode:
authortxh18 <cloudygooseg@gmail.com>2015-11-16 15:34:45 +0800
committertxh18 <cloudygooseg@gmail.com>2015-11-16 15:34:45 +0800
commita9300a1f6b3a101c5aef712b8f2f6049d4794484 (patch)
tree6635c853668ea6e298291e64c90f6f56e143691e /nerv/layer
parent6130e49bc87d812e921fd31c26f52ae487cf4242 (diff)
...
Diffstat (limited to 'nerv/layer')
-rw-r--r--nerv/layer/affine_recurrent.lua4
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)