Skip to content
GitLab
Menu
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
efdfcfff
Commit
efdfcfff
authored
Nov 29, 2017
by
Martin Reinecke
Browse files
fix mistakes
parent
85dc3a08
Pipeline
#22315
passed with stage
in 4 minutes and 46 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty/library/nonlinear_power_curvature.py
View file @
efdfcfff
...
...
@@ -5,9 +5,10 @@ from .response_operators import LinearizedPowerResponse
class
NonlinearPowerCurvature
(
EndomorphicOperator
):
def
__init__
(
self
,
position
,
Instrument
,
nonlinearity
,
def
__init__
(
self
,
position
,
FFT
,
Instrument
,
nonlinearity
,
Projection
,
N
,
T
,
sample_list
):
self
.
N
=
N
self
.
FFT
=
FFT
self
.
Instrument
=
Instrument
self
.
T
=
T
self
.
sample_list
=
sample_list
...
...
@@ -32,14 +33,17 @@ class NonlinearPowerCurvature(EndomorphicOperator):
return
False
def
_times
(
self
,
x
):
result
=
Field
.
zeros_like
(
self
.
position
,
dtype
=
np
.
float64
)
result
=
None
for
sample
in
self
.
sample_list
:
result
+=
self
.
_sample_times
(
x
,
sample
)
if
result
is
None
:
result
=
self
.
_sample_times
(
x
,
sample
)
else
:
result
+=
self
.
_sample_times
(
x
,
sample
)
result
*=
1.
/
len
(
self
.
sample_list
)
return
result
+
self
.
T
(
x
)
def
_sample_times
(
self
,
x
,
sample
):
LinearizedResponse
=
LinearizedPowerResponse
(
self
.
Instrument
,
self
.
nonlinearity
,
self
.
Projection
,
self
.
position
,
sample
)
self
.
FFT
,
self
.
Projection
,
self
.
position
,
sample
)
return
LinearizedResponse
.
adjoint_times
(
self
.
N
.
inverse_times
(
LinearizedResponse
(
x
)))
nifty/library/nonlinear_power_energy.py
View file @
efdfcfff
...
...
@@ -110,6 +110,6 @@ class NonlinearPowerEnergy(Energy):
@
property
@
memo
def
curvature
(
self
):
curvature
=
NonlinearPowerCurvature
(
self
.
position
,
self
.
Instrument
,
self
.
nonlinearity
,
curvature
=
NonlinearPowerCurvature
(
self
.
position
,
self
.
FFT
,
self
.
Instrument
,
self
.
nonlinearity
,
self
.
Projection
,
self
.
N
,
self
.
T
,
self
.
sample_list
)
return
InversionEnabler
(
curvature
,
inverter
=
self
.
inverter
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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