Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nam
ProxPython
Commits
9517285b
Commit
9517285b
authored
Apr 22, 2020
by
Matthijs
Browse files
folder structure to separate different cases
parent
73a6277f
Changes
9
Hide whitespace changes
Inline
Side-by-side
proxtoolbox/Algorithms/SimpleAlgortihm.py
View file @
9517285b
...
...
@@ -129,9 +129,8 @@ class SimpleAlgorithm:
if
hasattr
(
self
,
'truth'
):
Relerrs
=
change
.
copy
()
# Different algorithms will have different qualities that one
# should monitor. Since we take a fixed point perspective, the main
# thing to monitor is the change in the iterates.
# Different algorithms will have different qualities that one should monitor.
# Since we take a fixed point perspective, the main thing to monitor is the change in the iterates.
shadow
=
self
.
prox1
.
work
(
u
)
##### LOOP
...
...
@@ -143,18 +142,15 @@ class SimpleAlgorithm:
u_new
=
self
.
evaluate
(
u
)
if
self
.
diagnostic
:
# the next prox operation only gets used in the computation of
# the size of the gap. This extra step is not
# required in alternating projections, which makes RAAR
# the next prox operation only gets used in the computation of the size of the gap.
# This extra step is not required in alternating projections, which makes RAAR a bit slower
u2
=
self
.
prox2
.
work
(
u_new
)
u1
=
self
.
prox1
.
work
(
u2
)
# compute the normalized change in successive iterates:
# change(iter) = sum(sum((feval('P_M',M,u)-tmp).^2))/norm_data;
# compute the normalized change in successive iterates
tmp_change
=
0
tmp_gap
=
0
tmp_shadow
=
0
# the simple case, where everything can be calculated in one difference
if
self
.
product_space_dimension
==
1
or
(
p
==
1
and
q
==
1
):
tmp_change
=
phase_offset_compensated_norm
(
u
,
u_new
,
norm_type
=
'fro'
,
norm_factor
=
norm_data
)
**
2
...
...
@@ -216,9 +212,8 @@ class SimpleAlgorithm:
# update iterate
u
=
u_new
if
self
.
diagnostic
:
# For Douglas-Rachford,in general it is appropriate to monitor the SHADOWS of the iterates, since in
# the convex case these converge even for beta=1.
# (see Bauschke-Combettes-Luke, J. Approx. Theory, 2004)
# For Douglas-Rachford, in general it is appropriate to monitor the SHADOWS of the iterates, since in
# the convex case these converge even for beta=1. (see Bauschke-Combettes-Luke, J. Approx. Theory, 2004)
shadow
=
u2
##### POSTPROCESSING
...
...
proxtoolbox/Problems/OrbitalTomog/__init__.py
0 → 100644
View file @
9517285b
proxtoolbox/Problems/OrbitalTomog/molecule_3d/__init__.py
0 → 100644
View file @
9517285b
proxtoolbox/Problems/OrbitalTomog/orbital_tomog_3d_data_processor.py
→
proxtoolbox/Problems/OrbitalTomog/
molecule_3d/
orbital_tomog_3d_data_processor.py
View file @
9517285b
from
.orbitaltomog_data_processor
import
support_from_autocorrelation
from
proxtoolbox.Utilities.OrbitalTomog.array_tools
import
shifted_fft
,
shifted_ifft
from
proxtoolbox.Utilities.OrbitalTomog.binning
import
bin_2d_array
,
bin_array
from
proxtoolbox.Problems.OrbitalTomog.planar_molecule
.orbitaltomog_data_processor
import
support_from_autocorrelation
from
proxtoolbox.Utilities.OrbitalTomog.array_tools
import
shifted_fft
from
proxtoolbox.Utilities.OrbitalTomog.binning
import
bin_array
import
numpy
as
np
from
skimage.io
import
imread
from
.Graphics.stack_viewer
import
XYZStackViewer
from
proxtoolbox.Problems.OrbitalTomog
.Graphics.stack_viewer
import
XYZStackViewer
def
data_processor
(
config
):
...
...
proxtoolbox/Problems/OrbitalTomog/pentacene_3d_config.py
→
proxtoolbox/Problems/OrbitalTomog/
molecule_3d/
pentacene_3d_config.py
View file @
9517285b
...
...
@@ -103,7 +103,7 @@ new_config = {
'lambda_switch'
:
100
,
'sparsity_parameter'
:
100
,
'use_sparsity_with_support'
:
Fals
e
,
'use_sparsity_with_support'
:
Tru
e
,
'symmetry_type'
:
1
,
# -1 for antissymmetric functions, 1 for symmetric ones.
'symmetry_axis'
:
-
1
,
# which axis is symmetric. (mirror plane perpendicular to this axis)
...
...
proxtoolbox/Problems/OrbitalTomog/Coronene_demo.py
→
proxtoolbox/Problems/OrbitalTomog/
planar_molecule/
Coronene_demo.py
View file @
9517285b
from
proxtoolbox.Problems.OrbitalTomog
import
coronene_config
# base config
from
proxtoolbox.Problems.OrbitalTomog
import
orbitaltomog_data_processor
# extends config
from
proxtoolbox.Problems.OrbitalTomog.planar_molecule
import
coronene_config
,
orbitaltomog_data_processor
from
proxtoolbox.Problems.OrbitalTomog.phase
import
Phase
# sys.path.append('../proxtoolbox/Problems/Phase')
...
...
proxtoolbox/Problems/OrbitalTomog/planar_molecule/__init__.py
0 → 100644
View file @
9517285b
proxtoolbox/Problems/OrbitalTomog/coronene_config.py
→
proxtoolbox/Problems/OrbitalTomog/
planar_molecule/
coronene_config.py
View file @
9517285b
File moved
proxtoolbox/Problems/OrbitalTomog/orbitaltomog_data_processor.py
→
proxtoolbox/Problems/OrbitalTomog/
planar_molecule/
orbitaltomog_data_processor.py
View file @
9517285b
File moved
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment