summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcloudygoose <[email protected]>2015-07-10 11:16:21 +0800
committercloudygoose <[email protected]>2015-07-10 11:16:21 +0800
commit1972c47c4b78e26a1e57f5001fe030c37d360a49 (patch)
treec15e4e785a49d94eb24d4d61d237eced74560446
parent882541b311ae9f18c916609a74708cb29bc1abdd (diff)
added clip to layer_conf
-rw-r--r--nerv/layer/affine_recurrent.lua6
1 files changed, 5 insertions, 1 deletions
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()