aboutsummaryrefslogtreecommitdiff
path: root/nn/layer_repo.lua
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2015-06-22 19:01:29 +0800
committerDeterminant <[email protected]>2015-06-22 19:01:29 +0800
commit2497fd9e7a0fae5ee4887890d7a312e0e08a93b8 (patch)
tree382f97575bd2df9ee6abb1662b11b279fc22d72b /nn/layer_repo.lua
parent196e9b48a3541caccdffc5743001cced70667091 (diff)
major change: use luarocks to manage project
Diffstat (limited to 'nn/layer_repo.lua')
-rw-r--r--nn/layer_repo.lua34
1 files changed, 0 insertions, 34 deletions
diff --git a/nn/layer_repo.lua b/nn/layer_repo.lua
deleted file mode 100644
index 602c37c..0000000
--- a/nn/layer_repo.lua
+++ /dev/null
@@ -1,34 +0,0 @@
-local LayerRepo = nerv.class("nerv.LayerRepo")
-
-function LayerRepo:__init(layer_spec, param_repo, global_conf)
- local layers = {}
- for ltype, llist in pairs(layer_spec) do
- local layer_type = nerv.get_type(ltype)
- for id, spec in pairs(llist) do
- if layers[id] ~= nil then
- nerv.error("a layer with id %s already exists", id)
- end
- nerv.info("create layer: %s", id)
- if type(spec[2]) ~= "table" then
- nerv.error("layer config table is need")
- end
- layer_config = spec[2]
- if type(spec[1]) ~= "table" then
- nerv.error("parameter description table is needed")
- end
- for pname, pid in pairs(spec[1]) do
- layer_config[pname] = param_repo:get_param(pid)
- end
- layers[id] = layer_type(id, global_conf, layer_config)
- end
- end
- self.layers = layers
-end
-
-function LayerRepo:get_layer(lid)
- local layer = self.layers[lid]
- if layer == nil then
- nerv.error("layer with id %s not found", lid)
- end
- return layer
-end