summaryrefslogtreecommitdiff
path: root/NetGen/mathobj.py
diff options
context:
space:
mode:
authorJoe Zhao <ztuowen@gmail.com>2014-04-14 08:14:45 +0800
committerJoe Zhao <ztuowen@gmail.com>2014-04-14 08:14:45 +0800
commitcccccbf6cca94a3eaf813b4468453160e91c332b (patch)
tree23418cb73a10ae3b0688681a7f0ba9b06424583e /NetGen/mathobj.py
downloadtnet-cccccbf6cca94a3eaf813b4468453160e91c332b.tar.gz
tnet-cccccbf6cca94a3eaf813b4468453160e91c332b.tar.bz2
tnet-cccccbf6cca94a3eaf813b4468453160e91c332b.zip
First commit
Diffstat (limited to 'NetGen/mathobj.py')
-rw-r--r--NetGen/mathobj.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/NetGen/mathobj.py b/NetGen/mathobj.py
new file mode 100644
index 0000000..77dad90
--- /dev/null
+++ b/NetGen/mathobj.py
@@ -0,0 +1,32 @@
+'''
+Created on Mar 16, 2014
+
+@author: joe
+'''
+
+import math, random
+
+
+randomFnc=lambda :3*random.gauss(0.0,1.0)
+inputScale=True
+
+def PrintTransMatrix(rows,cols):
+ PrintMatrix(cols,rows)
+
+def PrintMatrix(rows,cols):
+ print 'm', rows, cols
+ for row in range(rows):
+ for col in range(cols):
+ if(inputScale):
+ print randomFnc()/math.sqrt(rows),
+ else:
+ print randomFnc(),
+ print
+
+def PrintVector(cols):
+ print 'v', cols
+ for col in range(cols):
+ print randomFnc(),
+ print
+
+ \ No newline at end of file