From 1972c47c4b78e26a1e57f5001fe030c37d360a49 Mon Sep 17 00:00:00 2001 From: cloudygoose Date: Fri, 10 Jul 2015 11:16:21 +0800 Subject: added clip to layer_conf --- nerv/layer/affine_recurrent.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nerv/layer/affine_recurrent.lua b/nerv/layer/affine_recurrent.lua index 5afdaa1..59d259c 100644 --- a/nerv/layer/affine_recurrent.lua +++ b/nerv/layer/affine_recurrent.lua @@ -15,6 +15,8 @@ function Recurrent:__init(id, global_conf, layer_conf) self:check_dim_len(2, 1) self.direct_update = layer_conf.direct_update + + self.clip = layer_conf.clip --clip error in back_propagate end --Check parameter @@ -75,7 +77,9 @@ function Recurrent:back_propagate(bp_err, next_bp_err, input, output) end end ]]-- - next_bp_err[2]:clip(-10, 10) + if (self.clip ~= nil) then + next_bp_err[2]:clip(-self.clip, self.clip) + end end function Recurrent:get_params() -- cgit v1.2.3-70-g09d2