comparison scripts/ABSapprox.py @ 23:c02eb33d2c54

Prepare to run whole script
author nikcleju
date Wed, 09 Nov 2011 00:13:27 +0000
parents 2dd78e37b23a
children c07440417bd8
comparison
equal deleted inserted replaced
22:2dd78e37b23a 23:c02eb33d2c54
55 nalgosL = len(algosL) 55 nalgosL = len(algosL)
56 56
57 #Set up experiment parameters 57 #Set up experiment parameters
58 d = 50; 58 d = 50;
59 sigma = 2.0 59 sigma = 2.0
60 #deltas = np.arange(0.05,0.95,0.05) 60 deltas = np.arange(0.05,0.95,0.05)
61 #rhos = np.arange(0.05,0.95,0.05) 61 rhos = np.arange(0.05,0.95,0.05)
62 deltas = np.array([0.05,0.95]) 62 #deltas = np.array([0.05,0.95])
63 rhos = np.array([0.05,0.95]) 63 #rhos = np.array([0.05,0.95])
64 #deltas = np.array([0.05]) 64 #deltas = np.array([0.05])
65 #rhos = np.array([0.05]) 65 #rhos = np.array([0.05])
66 #delta = 0.8; 66 #delta = 0.8;
67 #rho = 0.15; 67 #rho = 0.15;
68 numvects = 10; # Number of vectors to generate 68 numvects = 100; # Number of vectors to generate
69 SNRdb = 20.; # This is norm(signal)/norm(noise), so power, not energy 69 SNRdb = 20.; # This is norm(signal)/norm(noise), so power, not energy
70 # Values for lambda 70 # Values for lambda
71 #lambdas = [0 10.^linspace(-5, 4, 10)]; 71 #lambdas = [0 10.^linspace(-5, 4, 10)];
72 lambdas = np.concatenate((np.array([0]), 10**np.linspace(-5, 4, 10))) 72 lambdas = np.concatenate((np.array([0]), 10**np.linspace(-5, 4, 10)))
73 73
117 scipy.io.savemat('ABSapprox.mat',tosave) 117 scipy.io.savemat('ABSapprox.mat',tosave)
118 except TypeError: 118 except TypeError:
119 print "Oops, Type Error" 119 print "Oops, Type Error"
120 raise 120 raise
121 # Show 121 # Show
122 for algotuple in algosN: 122 # for algotuple in algosN:
123 plt.figure() 123 # plt.figure()
124 plt.imshow(meanmatrix[algotuple[1]], cmap=cm.gray, interpolation='nearest') 124 # plt.imshow(meanmatrix[algotuple[1]], cmap=cm.gray, interpolation='nearest')
125 for algotuple in algosL: 125 # for algotuple in algosL:
126 for ilbd in np.arange(lambdas.size): 126 # for ilbd in np.arange(lambdas.size):
127 plt.figure() 127 # plt.figure()
128 plt.imshow(meanmatrix[algotuple[1]][ilbd], cmap=cm.gray, interpolation='nearest') 128 # plt.imshow(meanmatrix[algotuple[1]][ilbd], cmap=cm.gray, interpolation='nearest')
129 plt.show() 129 # plt.show()
130 print "Finished." 130 print "Finished."
131 131
132 def genData(d,sigma,delta,rho,numvects,SNRdb): 132 def genData(d,sigma,delta,rho,numvects,SNRdb):
133 133
134 # Process parameters 134 # Process parameters