summaryrefslogtreecommitdiff
path: root/NetGen/mathobj.py
blob: 77dad903ba1cc07c3dd635b3de5e54b2ebee6e55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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