aboutsummaryrefslogtreecommitdiff
path: root/nerv/layer
diff options
context:
space:
mode:
Diffstat (limited to 'nerv/layer')
-rw-r--r--nerv/layer/duplicate.lua4
-rw-r--r--nerv/layer/identity.lua2
-rw-r--r--nerv/layer/init.lua1
3 files changed, 4 insertions, 3 deletions
diff --git a/nerv/layer/duplicate.lua b/nerv/layer/duplicate.lua
index fbd4a9e..1a93b26 100644
--- a/nerv/layer/duplicate.lua
+++ b/nerv/layer/duplicate.lua
@@ -30,9 +30,9 @@ function DuplicateLayer:propagate(input, output)
end
function DuplicateLayer:back_propagate(bp_err, next_bp_err)
- next_bp_err:copy_from(bp_err[1])
+ next_bp_err[1]:copy_from(bp_err[1])
for i = 2, #self.dim_out do
- next_bp_err:add(next_bp_err, bp_err[i], 1.0, 1.0)
+ next_bp_err[1]:add(next_bp_err[1], bp_err[i], 1.0, 1.0)
end
end
diff --git a/nerv/layer/identity.lua b/nerv/layer/identity.lua
index dc796fb..aeeff89 100644
--- a/nerv/layer/identity.lua
+++ b/nerv/layer/identity.lua
@@ -22,7 +22,7 @@ function IdentityLayer:propagate(input, output)
end
function IdentityLayer:back_propagate(bp_err, next_bp_err)
- next_bp_err[1]:copy_from(bp_err)
+ next_bp_err[1]:copy_from(bp_err[1])
end
function IdentityLayer:update()
diff --git a/nerv/layer/init.lua b/nerv/layer/init.lua
index 6f26d4d..39f97b1 100644
--- a/nerv/layer/init.lua
+++ b/nerv/layer/init.lua
@@ -126,6 +126,7 @@ nerv.include('dropout.lua')
nerv.include('gru.lua')
nerv.include('rnn.lua')
nerv.include('duplicate.lua')
+nerv.include('identity.lua')
-- The following lines are for backward compatibility, and will be removed in
-- the future. The use of these names are deprecated.