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
34a9882d
Commit
34a9882d
authored
Nov 04, 2019
by
markus.meier01
Browse files
Fixed some errors in CDP_candes
parent
771ed8f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
proxtoolbox/Problems/Phase/CDP_candes.py
View file @
34a9882d
from
numpy.random
import
randn
,
random_sample
from
numpy.matlib
import
repmat
from
numpy.linalg
import
norm
from
numpy
import
sqrt
,
conj
,
reshape
from
numpy.fft
import
fft2
,
ifft2
from
numpy
import
sqrt
,
conj
,
reshape
,
mean
import
matplotlib.pyplot
as
plt
import
numpy
as
np
import
random
...
...
@@ -22,7 +21,7 @@ def CDP_Candes(config):
## Make image
n1
=
128
,
n2
=
256
,
x
=
randn
(
n1
,
n2
)
+
1j
*
andn
(
n1
,
n2
)
x
=
randn
(
n1
,
n2
)
+
1j
*
r
andn
(
n1
,
n2
)
# Make masks and linear sampling operators
...
...
@@ -40,8 +39,8 @@ def CDP_Candes(config):
# Make linear operators; A is forward map and
# At its scaled adjoint (At(Y)*numel(Y) is the adjoint)
A
=
lambda
I
:
fft2
(
conj
(
Masks
)
*
reshape
(
repmat
(
I
,
1
,
L
),
np
.
size
(
I
,
1
),
np
.
size
(
I
,
2
)
,
L
))
# Input is n1 x n2 image, output is n1 x n2 x L array
At
=
lambda
Y
:
mean
(
Masks
*
ifft2
,
3
)
# Input is n1 x n2 X L array, output is n1 x n2 image
A
=
lambda
I
:
fft2
(
conj
(
Masks
)
*
reshape
(
tile
(
I
,
[
1
,
L
]
),
[
I
.
shape
[
0
],
I
.
shape
[
1
]
,
L
]
))
# Input is n1 x n2 image, output is n1 x n2 x L array
At
=
lambda
Y
:
mean
(
Masks
*
ifft2
,
axis
=
1
)
# Input is n1 x n2 X L array, output is n1 x n2 image
# Data
...
...
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