Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NIFTy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ift
NIFTy
Commits
aa0b1292
Commit
aa0b1292
authored
7 years ago
by
Philipp Arras
Browse files
Options
Downloads
Patches
Plain Diff
Cosmetics
parent
69da894e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
demos/getting_started_1.py
+9
-9
9 additions, 9 deletions
demos/getting_started_1.py
with
9 additions
and
9 deletions
demos/getting_started_1.py
+
9
−
9
View file @
aa0b1292
...
@@ -18,9 +18,9 @@ def make_random_mask():
...
@@ -18,9 +18,9 @@ def make_random_mask():
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
# # description of the tutorial ###
np
.
random
.
seed
(
42
)
np
.
random
.
seed
(
42
)
# FIXME description of the tutorial
# Choose problem geometry and masking
# Choose problem geometry and masking
# One dimensional regular grid
# One dimensional regular grid
...
@@ -38,7 +38,7 @@ if __name__ == '__main__':
...
@@ -38,7 +38,7 @@ if __name__ == '__main__':
harmonic_space
=
position_space
.
get_default_codomain
()
harmonic_space
=
position_space
.
get_default_codomain
()
HT
=
ift
.
HarmonicTransformOperator
(
harmonic_space
,
target
=
position_space
)
HT
=
ift
.
HarmonicTransformOperator
(
harmonic_space
,
target
=
position_space
)
#
s
et correlation structure with a power spectrum and build
#
S
et correlation structure with a power spectrum and build
# prior correlation covariance
# prior correlation covariance
def
power_spectrum
(
k
):
def
power_spectrum
(
k
):
return
100.
/
(
20.
+
k
**
3
)
return
100.
/
(
20.
+
k
**
3
)
...
@@ -48,7 +48,7 @@ if __name__ == '__main__':
...
@@ -48,7 +48,7 @@ if __name__ == '__main__':
S
=
ift
.
DiagonalOperator
(
prior_correlation_structure
)
S
=
ift
.
DiagonalOperator
(
prior_correlation_structure
)
#
b
uild instrument response consisting of a discretization, mask
#
B
uild instrument response consisting of a discretization, mask
# and harmonic transformaion
# and harmonic transformaion
GR
=
ift
.
GeometryRemover
(
position_space
)
GR
=
ift
.
GeometryRemover
(
position_space
)
mask
=
ift
.
Field
.
from_global_data
(
position_space
,
mask
)
mask
=
ift
.
Field
.
from_global_data
(
position_space
,
mask
)
...
@@ -57,19 +57,19 @@ if __name__ == '__main__':
...
@@ -57,19 +57,19 @@ if __name__ == '__main__':
data_space
=
GR
.
target
data_space
=
GR
.
target
#
s
et
ting
the noise covariance
#
S
et the noise covariance
noise
=
5.
noise
=
5.
N
=
ift
.
ScalingOperator
(
noise
,
data_space
)
N
=
ift
.
ScalingOperator
(
noise
,
data_space
)
#
c
reat
ing
mock data
#
C
reat
e
mock data
MOCK_SIGNAL
=
S
.
draw_sample
()
MOCK_SIGNAL
=
S
.
draw_sample
()
MOCK_NOISE
=
N
.
draw_sample
()
MOCK_NOISE
=
N
.
draw_sample
()
data
=
R
(
MOCK_SIGNAL
)
+
MOCK_NOISE
data
=
R
(
MOCK_SIGNAL
)
+
MOCK_NOISE
#
b
uild
ing
propagator D and information source j
#
B
uild propagator D and information source j
j
=
R
.
adjoint_times
(
N
.
inverse_times
(
data
))
j
=
R
.
adjoint_times
(
N
.
inverse_times
(
data
))
D_inv
=
R
.
adjoint
*
N
.
inverse
*
R
+
S
.
inverse
D_inv
=
R
.
adjoint
*
N
.
inverse
*
R
+
S
.
inverse
#
m
ake it invertible
#
M
ake it invertible
IC
=
ift
.
GradientNormController
(
iteration_limit
=
500
,
tol_abs_gradnorm
=
1e-3
)
IC
=
ift
.
GradientNormController
(
iteration_limit
=
500
,
tol_abs_gradnorm
=
1e-3
)
D
=
ift
.
InversionEnabler
(
D_inv
,
IC
,
approximation
=
S
.
inverse
).
inverse
D
=
ift
.
InversionEnabler
(
D_inv
,
IC
,
approximation
=
S
.
inverse
).
inverse
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment