Mercurial > hg > absrec
diff test_exact.py @ 15:a27cfe83fe12
Changing, changing, trying to get a common framework for batch jobs
author | Nic Cleju <nikcleju@gmail.com> |
---|---|
date | Tue, 20 Mar 2012 17:18:23 +0200 |
parents | f2eb027ed101 |
children |
line wrap: on
line diff
--- a/test_exact.py Fri Mar 16 13:42:31 2012 +0200 +++ b/test_exact.py Tue Mar 20 17:18:23 2012 +0200 @@ -24,16 +24,6 @@ import pyCSalgos.BP.l1eq_pd import pyCSalgos.NESTA.NESTA -#def printsafe(*t): -# """ -# Thread-safe version of print(). -# Acquires lock before printing, releases it after. -# """ -# if _currmodule._printLock: -# _currmodule._printLock.acquire() -# print t -# _currmodule._printLock.release() - def _initProcess(share, njobs, printLock): """ @@ -141,7 +131,6 @@ # Thread-safe variable to store number of finished jobs _currmodule.proccount = multiprocessing.Value('I', 0) # 'I' = unsigned int, see docs (multiprocessing, array) - # Run jobresults = [] @@ -289,33 +278,6 @@ return Omega,x0,y,M,realnoise - -#def runsingleexampledebug(): -# d = 50.0; -# sigma = 2.0 -# delta = 0.9 -# rho = 0.05 -# numvects = 20; # Number of vectors to generate -# SNRdb = 7.; # This is norm(signal)/norm(noise), so power, not energy -# lbd = 10000 -# -# Omega,x0,y,M,realnoise = generateData(d,sigma,delta,rho,numvects,SNRdb) -# D = numpy.linalg.pinv(Omega) -# U,S,Vt = numpy.linalg.svd(D) -# -# xrec = numpy.zeros((d, y.shape[1])) -# err = numpy.zeros((y.shape[1])) -# relerr = numpy.zeros((y.shape[1])) -# -# for iy in numpy.arange(y.shape[1]): -# epsilon = 1.1 * numpy.linalg.norm(realnoise[:,iy]) -# gamma = run_sl0(y[:,iy],M,Omega,D,U,S,Vt,epsilon,lbd) -# xrec[:,iy] = numpy.dot(D,gamma) -# err[iy] = numpy.linalg.norm(x0[:,iy] - xrec[:,iy]) -# relerr[iy] = err[iy] / numpy.linalg.norm(x0[:,iy]) -# -# print "Finished runsingleexampledebug()" - def testMatlab(): mdict = scipy.io.loadmat("E:\\CS\\Ale mele\\Analysis_ExactRec\\temp.mat")