diff stdparams_exact.py @ 14:f2eb027ed101

test_exact.py working. Added bp_cvxopt(). Commented the code that made the operator Omega more coherent.
author Nic Cleju <nikcleju@gmail.com>
date Fri, 16 Mar 2012 13:42:31 +0200
parents
children a27cfe83fe12
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stdparams_exact.py	Fri Mar 16 13:42:31 2012 +0200
@@ -0,0 +1,147 @@
+# -*- coding: utf-8 -*-
+"""
+Created on Wed Dec 07 14:04:40 2011
+
+@author: ncleju
+"""
+
+import numpy
+from algos import *
+
+#==========================
+# Standard parameters
+#==========================
+# Standard parameters for quick testing
+# Algorithms: GAP, SL0 and BP
+# d=50, sigma = 2, delta and rho only 3 x 3, lambdas = 0, 1e-4, 1e-2, 1, 100, 10000
+# Do save data, do save plots, don't show plots
+# Useful for short testing 
+def stdtest():
+  # Define which algorithms to run
+  #algos = exact_gap,exact_sl0,exact_bp,exact_ompeps,exact_tst       # tuple of algorithms
+  algos = exact_bp_cvxopt,       # tuple of algorithms
+  
+  d = 50.0
+  sigma = 1.2
+  deltas = numpy.array([0.05, 0.45, 0.95])
+  rhos = numpy.array([0.05, 0.45, 0.95])
+  #deltas = numpy.array([0.6])
+  #deltas = numpy.arange(0.05,1.,0.05)
+  #rhos = numpy.array([0.05])
+  numvects = 10; # Number of vectors to generate
+  SNRdb = 100.;    # This is norm(signal)/norm(noise), so power, not energy
+  
+  dosavedata = True
+  savedataname = 'exact_pt_stdtest.mat'
+  doshowplot = False
+  dosaveplot = True
+  saveplotbase = 'exact_pt_stdtest_'
+  saveplotexts = ('png','pdf','eps')
+
+  return algos,d,sigma,deltas,rhos,numvects,SNRdb,dosavedata,savedataname,\
+          doshowplot,dosaveplot,saveplotbase,saveplotexts   
+
+
+# Standard parameters 1
+# All algorithms, 100 vectors
+# d=50, sigma = 2, delta and rho full resolution (0.05 step), lambdas = 0, 1e-4, 1e-2, 1, 100, 10000
+# Do save data, do save plots, don't show plots
+def std1():
+  # Define which algorithms to run
+  algos = exact_gap,exact_sl0,exact_bp_cvxopt,exact_ompeps,exact_tst       # tuple of algorithms
+  
+  d = 50.0;
+  sigma = 1.2
+  deltas = numpy.arange(0.05,1.,0.05)
+  rhos = numpy.arange(0.05,1.,0.05)
+  numvects = 100; # Number of vectors to generate
+  SNRdb = 100.;    # This is norm(signal)/norm(noise), so power, not energy
+  
+  dosavedata = True
+  savedataname = 'exact_pt_std1.mat'
+  doshowplot = False
+  dosaveplot = True
+  saveplotbase = 'exact_pt_std1_'
+  saveplotexts = ('png','pdf','eps')
+
+  return algos,d,sigma,deltas,rhos,numvects,SNRdb,dosavedata,savedataname,\
+          doshowplot,dosaveplot,saveplotbase,saveplotexts
+          
+         
+# Standard parameters 2
+# All algorithms, 100 vectors
+# d=20, sigma = 10, delta and rho full resolution (0.05 step), lambdas = 0, 1e-4, 1e-2, 1, 100, 10000
+# Do save data, do save plots, don't show plots
+def std2():
+  # Define which algorithms to run
+  algos = exact_gap,exact_sl0,exact_bp_cvxopt,exact_ompeps,exact_tst       # tuple of algorithms
+  
+  d = 20.0
+  sigma = 10.0
+  deltas = numpy.arange(0.05,1.,0.05)
+  rhos = numpy.arange(0.05,1.,0.05)
+  numvects = 100; # Number of vectors to generate
+  SNRdb = 100.;    # This is norm(signal)/norm(noise), so power, not energy
+  
+  dosavedata = True
+  savedataname = 'exact_pt_std2.mat'
+  doshowplot = False
+  dosaveplot = True
+  saveplotbase = 'exact_pt_std2_'
+  saveplotexts = ('png','pdf','eps')
+
+  return algos,d,sigma,deltas,rhos,numvects,SNRdb,dosavedata,savedataname,\
+          doshowplot,dosaveplot,saveplotbase,saveplotexts
+  
+  
+#  # Standard parameters 3
+## All algorithms, 100 vectors
+## d=50, sigma = 2, delta and rho full resolution (0.05 step), lambdas = 0, 1e-4, 1e-2, 1, 100, 10000
+## Do save data, do save plots, don't show plots
+## IDENTICAL with 1 but with 10dB SNR noise
+#def std3():
+#  # Define which algorithms to run
+#  algos = exact_gap,exact_sl0,exact_bp,exact_ompeps,exact_tst       # tuple of algorithms
+#  
+#  d = 50.0;
+#  sigma = 2.0
+#  deltas = numpy.arange(0.05,1.,0.05)
+#  rhos = numpy.arange(0.05,1.,0.05)
+#  numvects = 100; # Number of vectors to generate
+#  SNRdb = 100.;    # This is norm(signal)/norm(noise), so power, not energy
+#  
+#  dosavedata = True
+#  savedataname = 'exact_pt_std3.mat'
+#  doshowplot = False
+#  dosaveplot = True
+#  saveplotbase = 'exact_pt_std3_'
+#  saveplotexts = ('png','pdf','eps')
+#
+#  return algos,d,sigma,deltas,rhos,numvects,SNRdb,dosavedata,savedataname,\
+#          doshowplot,dosaveplot,saveplotbase,saveplotexts
+          
+## Standard parameters 4
+## All algorithms, 100 vectors
+## d=20, sigma = 10, delta and rho full resolution (0.05 step), lambdas = 0, 1e-4, 1e-2, 1, 100, 10000
+## Do save data, do save plots, don't show plots
+## Identical to 2 but with 10dB SNR noise
+#def std4():
+#  # Define which algorithms to run
+#  algos = exact_gap,exact_sl0,exact_bp,exact_ompeps,exact_tst       # tuple of algorithms
+#  
+#  d = 20.0
+#  sigma = 10.0
+#  deltas = numpy.arange(0.05,1.,0.05)
+#  rhos = numpy.arange(0.05,1.,0.05)
+#  numvects = 100; # Number of vectors to generate
+#  SNRdb = 10.;    # This is norm(signal)/norm(noise), so power, not energy
+#  
+#  dosavedata = True
+#  savedataname = 'exact_pt_std4.mat'
+#  doshowplot = False
+#  dosaveplot = True
+#  saveplotbase = 'exact_pt_std4_'
+#  saveplotexts = ('png','pdf','eps')
+#
+#  return algos,d,sigma,deltas,rhos,numvects,SNRdb,dosavedata,savedataname,\
+#          doshowplot,dosaveplot,saveplotbase,saveplotexts