annotate SL0_pt_noise.py @ 21:d395461b92ae tip

Lots and lots of modifications. Approximate recovery script working.
author Nic Cleju <nikcleju@gmail.com>
date Mon, 23 Apr 2012 10:54:57 +0300
parents 7fdf964f4edd
children
rev   line source
nikcleju@3 1 # -*- coding: utf-8 -*-
nikcleju@3 2 """
nikcleju@17 3 Test SL0 behavior in the presence of strong noise
nikcleju@3 4
nikcleju@17 5 Author: Nicolae Cleju
nikcleju@3 6 """
nikcleju@3 7
nikcleju@3 8 from algos import *
nikcleju@3 9 import ABSapprox
nikcleju@3 10 import stdparams
nikcleju@3 11
nikcleju@3 12
nikcleju@3 13 def run_mp():
nikcleju@3 14
nikcleju@3 15 SNRs = numpy.array([4., 7., 10., 13., 16., 19.])
nikcleju@3 16
nikcleju@3 17 # Default params
nikcleju@3 18 algosN,algosL,d,sigma,deltas,rhos,lambdas,numvects,SNRdb,dosavedata,\
nikcleju@3 19 savedataname,doshowplot,dosaveplot,saveplotbase,saveplotexts = stdparams.std1()
nikcleju@3 20
nikcleju@3 21 # Set only SL0 algorithms
nikcleju@3 22 algosN = (sl0analysis,)
nikcleju@3 23 algosL = (sl0,)
nikcleju@3 24
nikcleju@3 25 # Overwrite SNRdb:
nikcleju@3 26 for SNRdb in SNRs:
nikcleju@4 27 savedataname = 'approx_pt_sl0_SNR'+ str(int(SNRdb)) +'.mat'
nikcleju@4 28 saveplotbase = 'approx_pt_sl0_SNR'+ str(int(SNRdb)) +'_'
nikcleju@3 29
nikcleju@3 30 # Run
nikcleju@3 31 ABSapprox.run_multi(algosN,algosL,d,sigma,deltas,rhos,lambdas,numvects,SNRdb,\
nikcleju@3 32 dosavedata=dosavedata,savedataname=savedataname,doparallel=True, ncpus=None,\
nikcleju@3 33 doshowplot=doshowplot,dosaveplot=dosaveplot,saveplotbase=saveplotbase,saveplotexts=saveplotexts)
nikcleju@3 34
nikcleju@3 35 # Script main
nikcleju@3 36 if __name__ == "__main__":
nikcleju@3 37 #import cProfile
nikcleju@3 38 #cProfile.run('mainrun()', 'profile')
nikcleju@3 39 run_mp()
nikcleju@3 40 #runsingleexampledebug()