aboutsummaryrefslogtreecommitdiff
path: root/nerv/layer/projection.lua
diff options
context:
space:
mode:
Diffstat (limited to 'nerv/layer/projection.lua')
-rw-r--r--nerv/layer/projection.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/nerv/layer/projection.lua b/nerv/layer/projection.lua
index d99401c..9d376bd 100644
--- a/nerv/layer/projection.lua
+++ b/nerv/layer/projection.lua
@@ -8,12 +8,18 @@ function ProjectionLayer:__init(id, global_conf, layer_conf)
end
function ProjectionLayer:bind_params()
+ local lconf = self.lconf
+ lconf.no_update_ltp1 = lconf.no_update_ltp1 or lconf.no_update_ltp
for i = 1, #self.dim_in do
local pid = "ltp" .. i
local pid_list = i == 1 and {pid, "ltp"} or pid
- self["ltp" .. i] = self:find_param(pid_list, self.lconf, self.gconf,
+ self["ltp" .. i] = self:find_param(pid_list, lconf, self.gconf,
nerv.LinearTransParam,
{self.dim_in[i], self.dim_out[1]})
+ local no_update = lconf["no_update_ltp" .. i]
+ if (no_update ~= nil) and no_update or lconf.no_update_all then
+ self["ltp" .. i].no_update = true
+ end
end
self.ltp = self.ltp1 -- alias of ltp1
end