aboutsummaryrefslogtreecommitdiff
path: root/nerv/layer/graph.lua
diff options
context:
space:
mode:
Diffstat (limited to 'nerv/layer/graph.lua')
-rw-r--r--nerv/layer/graph.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/nerv/layer/graph.lua b/nerv/layer/graph.lua
index 68d5f51..ddbc85e 100644
--- a/nerv/layer/graph.lua
+++ b/nerv/layer/graph.lua
@@ -65,7 +65,17 @@ function GraphLayer:discover(id, layer_repo)
return ref
end
+local function reverse(connections)
+ for i = 1, #connections do
+ connections[i][3] = connections[i][3] * -1
+ end
+end
+
function GraphLayer:graph_init(layer_repo, connections)
+ if self.lconf.reversed then
+ reverse(connections)
+ end
+
local layers = {}
layers['<input>'] = {
inputs = {},