From 0e738af4bb1eda301564d8469178a7581b0cbcce Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 19 May 2015 15:09:06 +0800 Subject: ... --- mmatrix_example.lua | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'mmatrix_example.lua') diff --git a/mmatrix_example.lua b/mmatrix_example.lua index 5b34779..39cd28e 100644 --- a/mmatrix_example.lua +++ b/mmatrix_example.lua @@ -1,9 +1,16 @@ -t = nerv.FloatMMatrix(5, 10) -a = t[1] -for i = 0, 4 do - for j = 0, 9 do - t[i][j] = i + j +m = 10 +n = 10 +fm = nerv.FloatMMatrix(m, n) +dm = nerv.DoubleMMatrix(m, n) +for i = 0, m - 1 do + for j = 0, n - 1 do + -- local t = math.random(10) + t = i / (j + 1) + fm[i][j] = t + dm[i][j] = t end end -print(t) -print(a) +print(fm) +-- print(fm:softmax()) +print(dm) +-- print(dm:softmax()) -- cgit v1.2.3