aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2015-05-30 20:52:05 +0800
committerDeterminant <[email protected]>2015-05-30 20:52:05 +0800
commit5edaa7d5649a2e124496159f7e8a14edab4f7484 (patch)
treed880fd9587acb87701921583ada3b6aae65bbbda /examples
parentf10330fd95aa87cf6b21d292cf54c77bacfd2e40 (diff)
rename param file to chunk file (intend to generalize it)
Diffstat (limited to 'examples')
-rw-r--r--examples/test_dnn_layers.lua13
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/test_dnn_layers.lua b/examples/test_dnn_layers.lua
index c57de6d..866e685 100644
--- a/examples/test_dnn_layers.lua
+++ b/examples/test_dnn_layers.lua
@@ -2,11 +2,12 @@ require 'layer.affine'
require 'layer.sigmoid'
require 'layer.softmax_ce'
-global_conf = {lrate = 0.8, wcost = 1e-6, momentum = 0.9}
+global_conf = {lrate = 0.8, wcost = 1e-6,
+ momentum = 0.9, mat_type = nerv.CuMatrixFloat}
-pf = nerv.ParamFile("affine.param", "r")
-ltp = pf:read_param("a")
-bp = pf:read_param("b")
+pf = nerv.ChunkFile("affine.param", "r")
+ltp = pf:read_chunk("a", global_conf)
+bp = pf:read_chunk("b", global_conf)
-- print(bp.trans)
@@ -18,7 +19,7 @@ af:init()
sg:init()
sm:init()
-df = nerv.ParamFile("input.param", "r")
+df = nerv.ChunkFile("input.param", "r")
label = nerv.CuMatrixFloat(10, 2048)
label:fill(0)
@@ -26,7 +27,7 @@ for i = 0, 9 do
label[i][i] = 1.0
end
-input1 = {[0] = df:read_param("input").trans}
+input1 = {[0] = df:read_chunk("input", global_conf).trans}
output1 = {[0] = nerv.CuMatrixFloat(10, 2048)}
input2 = output1
output2 = {[0] = nerv.CuMatrixFloat(10, 2048)}