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
baea9872
Commit
baea9872
authored
Apr 24, 2017
by
alexander.dornheim
Browse files
In phase fixed a bug in calculation of gap_0
parent
086bec98
Changes
1
Hide whitespace changes
Inline
Side-by-side
proxtoolbox/Problems/Phase/phase.py
View file @
baea9872
...
...
@@ -173,16 +173,27 @@ class Phase(Problem):
proj2
=
self
.
config
[
'proxoperators'
][
1
](
self
.
config
)
u_2
=
proj2
.
work
(
u_1
);
print
(
norm
(
self
.
config
[
'u_0'
]))
print
(
norm
(
u_1
))
print
(
norm
(
u_2
))
print
(
norm
(
u_1
-
u_2
))
print
(
self
.
config
[
'norm_rt_data'
])
#print(nonzero(u_1))
print
(
u_1
[
51
,
55
]);
print
(
size
(
self
.
config
[
'support_idx'
][
1
]))
print
(
u_2
[
51
,
55
])
print
(
proj2
)
# estimate the gap in the relevant metric
if
self
.
config
[
'Nx'
]
==
1
or
self
.
config
[
'Ny'
]
==
1
:
tmp_gap
=
square
(
norm
(
u_1
-
u_2
)
/
self
.
config
[
'norm_rt_data'
]);
elif
self
.
config
[
'product_space_dimension'
]
==
1
:
tmp_gap
=
(
norm
(
u_1
-
u_2
)
/
square
(
self
.
config
[
'norm_rt_data'
])
);
tmp_gap
=
(
norm
(
u_1
-
u_2
)
/
self
.
config
[
'norm_rt_data'
])
**
2
else
:
tmp_gap
=
0
;
for
j
in
range
(
self
.
config
[
'product_space_dimension'
]):
# compute (||P_Sx-P_Mx||/normM)^2:
tmp_gap
=
tmp_gap
+
(
norm
(
u_1
[:,:,
j
]
-
u_2
[:,:,
j
])
/
square
(
self
.
config
[
'norm_rt_data'
])
);
tmp_gap
=
tmp_gap
+
(
norm
(
u_1
[:,:,
j
]
-
u_2
[:,:,
j
])
/
self
.
config
[
'norm_rt_data'
])
**
2
gap_0
=
sqrt
(
tmp_gap
);
print
(
gap_0
)
...
...
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