diff options
author | Determinant <[email protected]> | 2015-05-19 15:09:06 +0800 |
---|---|---|
committer | Determinant <[email protected]> | 2015-05-19 15:09:06 +0800 |
commit | 0e738af4bb1eda301564d8469178a7581b0cbcce (patch) | |
tree | 4e94320a4a27d8a01bb4419b444d16d80b96a8d2 /mmatrix_example.lua | |
parent | e9b8855c894daa4e6749acfe891f68b3ed8ed481 (diff) |
...
Diffstat (limited to 'mmatrix_example.lua')
-rw-r--r-- | mmatrix_example.lua | 21 |
1 files changed, 14 insertions, 7 deletions
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()) |