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
ift
NIFTy
Commits
30f8f70c
Commit
30f8f70c
authored
Oct 02, 2018
by
Philipp Arras
Browse files
Fixup in SlopeOperator
parent
2d3f070c
Changes
2
Hide whitespace changes
Inline
Side-by-side
demos/getting_started_3.py
View file @
30f8f70c
...
...
@@ -29,6 +29,7 @@ def get_random_LOS(n_los):
if
__name__
==
'__main__'
:
# FIXME description of the tutorial
np
.
random
.
seed
(
42
)
np
.
seterr
(
all
=
'raise'
)
position_space
=
ift
.
RGSpace
([
128
,
128
])
# Setting up an amplitude model
...
...
@@ -81,7 +82,7 @@ if __name__ == '__main__':
# build model Hamiltonian
H
=
ift
.
Hamiltonian
(
likelihood
,
ic_sampling
)
INITIAL_POSITION
=
ift
.
f
rom_random
(
'normal'
,
domain
)
INITIAL_POSITION
=
ift
.
f
ull
(
H
.
domain
,
0.
)
position
=
INITIAL_POSITION
plot
=
ift
.
Plot
()
...
...
nifty5/operators/slope_operator.py
View file @
30f8f70c
...
...
@@ -81,5 +81,5 @@ class SlopeOperator(LinearOperator):
xglob
=
x
.
to_global_data
()
res
[
-
1
]
=
np
.
sum
(
xglob
[
1
:])
for
i
in
range
(
self
.
ndim
):
res
[
i
]
=
np
.
sum
(
(
self
.
pos
[
i
]
*
xglob
)
[
1
:])
res
[
i
]
=
np
.
sum
(
self
.
pos
[
i
]
[
1
:]
*
xglob
[
1
:])
return
Field
.
from_global_data
(
self
.
domain
,
res
)
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