aboutsummaryrefslogtreecommitdiff
path: root/cumatrix_example.lua
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2015-05-18 19:29:37 +0800
committerDeterminant <[email protected]>2015-05-18 19:29:37 +0800
commit23fd2694723ab3f2203e6cd040c5e6633cb989c7 (patch)
tree407e5b1f2826df831336fbb8f1bfd69f8ca6e7c5 /cumatrix_example.lua
parent0f953414dfdbd7abb7b867ce0c3f9390551c1083 (diff)
add rowsum for cumatrix
Diffstat (limited to 'cumatrix_example.lua')
-rw-r--r--cumatrix_example.lua29
1 files changed, 8 insertions, 21 deletions
diff --git a/cumatrix_example.lua b/cumatrix_example.lua
index ce11eea..88b5912 100644
--- a/cumatrix_example.lua
+++ b/cumatrix_example.lua
@@ -1,28 +1,15 @@
-m = 2
-n = 3
+m = 600
+n = 600
t = nerv.FloatCuMatrix(m, n)
t2 = nerv.FloatCuMatrix(m, n)
-print(t)
+-- print(t)
a = t[1]
for i = 0, m - 1 do
+ tt = t[i]
+ tt2 = t2[i]
for j = 0, n - 1 do
- t[i][j] = i + j
- t2[i][j] = t[i][j]
+ tt[j] = i + j
+ tt2[j] = t[i][j]
end
end
-print(a)
-print(t)
-print(t2)
-print(t + t2)
-d = nerv.FloatCuMatrix(3, 3)
-for i = 0, 2 do
- for j = 0, 2 do
- d[i][j] = 0
- end
-end
-d[0][0] = 1
-d[1][1] = 2
-d[2][2] = 3
-print(d)
-print(t * d)
-print(t:sigmoid())
+-- print(t:rowsum())