Dear Gitlab Users, for our upcoming upgrade to Gitlab v14, Gitlab will be unavailable on Thursday, 05.08.2021 from 5:00 pm to approximately 7:00 pm. Note that with v14, certain breaking changes will be introduced (https://about.gitlab.com/blog/2021/06/04/gitlab-moving-to-14-breaking-changes/).

Commit 39025e48 authored by Russell Luke's avatar Russell Luke
Browse files

monitoring the power...not informative

parent ed19f286
......@@ -2,6 +2,6 @@ import pdb
import SetProxPythonPath
from proxtoolbox.experiments.phase.Elser_Experiment import Elser_Experiment
Elser = Elser_Experiment(Atoms=100, category='E', algorithm='DRl', lambda_0=0.5, lambda_max=0.5, MAXIT=500, anim=False)
Elser = Elser_Experiment(Atoms=300, category='E', algorithm='DRl', lambda_0=0.55, lambda_max=0.55, supp=300, MAXIT=500, anim=True)
Elser.run()
Elser.show()
......@@ -2,6 +2,6 @@ import pdb
import SetProxPythonPath
from proxtoolbox.experiments.phase.Elser_Experiment import Elser_Experiment
Elser = Elser_Experiment(Atoms=100, category='E', algorithm='RRR', lambda_0=0.50, lambda_max=0.50, anim=True)
Elser = Elser_Experiment(Atoms=300, category='E', algorithm='RRR', MAXIT=500, lambda_0=0.50, lambda_max=0.50, anim=False)
Elser.run()
Elser.show()
......@@ -28,6 +28,7 @@ class Algorithm:
self.prox2 = self.proxOperators[1]
self.norm_data = experiment.norm_data
self.norm_data_sq = experiment.norm_data_sq
self.Nx = experiment.Nx
self.Ny = experiment.Ny
self.Nz = experiment.Nz
......
......@@ -19,6 +19,7 @@ class IterateMonitor:
self.u_monitor = self.u0 # the part of the sequence that is being monitored put u0 as default
self.isCell = isCell(self.u0)
self.norm_data = experiment.norm_data
self.norm_data_sq = experiment.norm_data_sq
self.truth = experiment.truth
self.truth_dim = experiment.truth_dim
self.formulation = experiment.formulation
......
......@@ -36,6 +36,7 @@ class Elser_Experiment(PhaseExperiment):
'Ny': 128,
'Nz': 1,
'Atoms':100,
'supp':None,
'category': 'E',
'product_space_dimension': 2,
'MAXIT': 1000,
......@@ -52,7 +53,7 @@ class Elser_Experiment(PhaseExperiment):
return defaultParams
def __init__(self, Atoms=100, category='E', **kwargs):
def __init__(self, Atoms=100, category='E', supp=800, **kwargs):
super(Elser_Experiment, self).__init__(**kwargs)
self.fresnel_nr = None
self.use_farfield_formula = None
......@@ -64,6 +65,7 @@ class Elser_Experiment(PhaseExperiment):
self.FT_conv_kernel = Cell(1)
self.Atoms=Atoms
self.category=category
self.sparsity_parameter=supp
def loadData(self):
# def loadElserData(filename, M):
"""
......@@ -130,7 +132,8 @@ class Elser_Experiment(PhaseExperiment):
# The support constraint is sparsity determined by the number of atoms indicated in the
# data file name...this needs to be installed
self.sparsity_parameter = 2.5*self.Atoms # this is the variable `supp' in Elser's code
if self.sparsity_parameter is None:
self.sparsity_parameter = 8*self.Atoms # this is the variable `supp' in Elser's code
# initial guess: doesn't quite follow Elser's initialization, but close enough
perturb = (np.random.rand(self.Nx, self.Ny)).T # to match Matlab
......@@ -214,8 +217,35 @@ class Elser_Experiment(PhaseExperiment):
# call parent to display the other plots
super(Elser_Experiment, self).show()
"""
Generate graphical output from the solution
"""
algo_desc = self.algorithm.getDescription()
title = "Algorithm: " + algo_desc
label = "Iterations"
#figure 9??
if 'pow0' in self.output['stats']:
pow0 = self.output['stats']['pow0']
f = plt.figure(figsize = (self.figure_width, self.figure_height))
plt.plot(pow0)
plt.xlabel(label)
plt.ylabel('pow0')
f.suptitle(title)
#figure 9??
if 'pow1' in self.output['stats']:
pow1 = self.output['stats']['pow1']
f = plt.figure(figsize = (self.figure_width, self.figure_height))
plt.plot(pow1)
plt.xlabel(label)
plt.ylabel('pow1')
f.suptitle(title)
show()
if __name__ == "__main__":
Elser = Elser_Experiment(Atoms=200, category='E', algorithm='RRR', lambda_0=0.95, lambda_max=0.95, anim=True)
Elser = Elser_Experiment(Atoms=200, category='E', algorithm='RRR', lambda_0=0.95, lambda_max=0.95, anim=False)
Elser.run()
Elser.show()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment