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
10966a24
Commit
10966a24
authored
Jun 01, 2017
by
Jakob Knollmueller
Browse files
working on laplace
parent
3c0b82ce
Pipeline
#13201
failed with stage
in 6 minutes and 17 seconds
Changes
20
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
demos/.DS_Store
0 → 100644
View file @
10966a24
File added
demos/critical_filtering.py
View file @
10966a24
...
...
@@ -8,33 +8,33 @@ from mpi4py import MPI
comm
=
MPI
.
COMM_WORLD
rank
=
comm
.
rank
np
.
random
.
seed
(
6
2
)
np
.
random
.
seed
(
23
2
)
class
NonlinearResponse
(
LinearOperator
):
def
__init__
(
self
,
FFT
,
Instrument
,
function
,
derivative
,
default_spaces
=
None
):
super
(
NonlinearResponse
,
self
).
__init__
(
default_spaces
)
def
plot_parameters
(
m
,
t
,
t_true
,
t_real
,
t_d
):
m
=
fft
.
adjoint_times
(
m
)
m_data
=
m
.
val
.
get_full_data
().
real
t_data
=
t
.
val
.
get_full_data
().
real
t_d_data
=
t_d
.
val
.
get_full_data
().
real
t_true_data
=
t_true
.
val
.
get_full_data
().
real
t_real_data
=
t_real
.
val
.
get_full_data
().
real
pl
.
plot
([
go
.
Heatmap
(
z
=
m_data
)],
filename
=
'map.html'
)
pl
.
plot
([
go
.
Scatter
(
y
=
t_data
),
go
.
Scatter
(
y
=
t_true_data
),
go
.
Scatter
(
y
=
t_real_data
),
go
.
Scatter
(
y
=
t_d_data
)],
filename
=
"t.html"
)
class
AdjointFFTResponse
(
LinearOperator
):
def
__init__
(
self
,
FFT
,
R
,
default_spaces
=
None
):
super
(
AdjointFFTResponse
,
self
).
__init__
(
default_spaces
)
self
.
_domain
=
FFT
.
target
self
.
_target
=
Instrument
.
target
self
.
function
=
function
self
.
derivative
=
derivative
self
.
I
=
Instrument
self
.
_target
=
R
.
target
self
.
R
=
R
self
.
FFT
=
FFT
def
_times
(
self
,
x
,
spaces
=
None
):
return
self
.
I
(
self
.
function
(
self
.
FFT
.
adjoint_times
(
x
))
)
return
self
.
R
(
self
.
FFT
.
adjoint_times
(
x
))
def
_adjoint_times
(
self
,
x
,
spaces
=
None
):
return
self
.
FFT
(
self
.
function
(
self
.
I
.
adjoint_times
(
x
)))
def
derived_times
(
self
,
x
,
position
):
position_derivative
=
self
.
derivative
(
self
.
FFT
.
adjoint_times
(
position
))
return
self
.
I
(
position_derivative
*
self
.
FFT
.
adjoint_times
(
x
))
def
derived_adjoint_times
(
self
,
x
,
position
):
position_derivative
=
self
.
derivative
(
self
.
FFT
.
adjoint_times
(
position
))
return
self
.
FFT
(
position_derivative
*
self
.
I
.
adjoint_times
(
x
))
return
self
.
FFT
(
self
.
R
.
adjoint_times
(
x
))
@
property
def
domain
(
self
):
return
self
.
_domain
...
...
@@ -47,16 +47,6 @@ class NonlinearResponse(LinearOperator):
def
unitary
(
self
):
return
False
def
plot_parameters
(
m
,
t
,
t_true
,
t_real
):
m
=
fft
.
adjoint_times
(
m
)
m_data
=
m
.
val
.
get_full_data
().
real
t_data
=
t
.
val
.
get_full_data
().
real
t_true_data
=
t_true
.
val
.
get_full_data
().
real
t_real_data
=
t_real
.
val
.
get_full_data
().
real
pl
.
plot
([
go
.
Heatmap
(
z
=
m_data
)],
filename
=
'map.html'
)
pl
.
plot
([
go
.
Scatter
(
y
=
t_data
),
go
.
Scatter
(
y
=
t_true_data
),
go
.
Scatter
(
y
=
t_real_data
)],
filename
=
"t.html"
)
if
__name__
==
"__main__"
:
distribution_strategy
=
'not'
...
...
@@ -70,11 +60,11 @@ if __name__ == "__main__":
h_space
=
fft
.
target
[
0
]
# Setting up power space
p_space
=
PowerSpace
(
h_space
,
logarithmic
=
Tru
e
,
distribution_strategy
=
distribution_strategy
)
p_space
=
PowerSpace
(
h_space
,
logarithmic
=
Fals
e
,
distribution_strategy
=
distribution_strategy
,
nbin
=
128
)
# Choosing the prior correlation structure and defining correlation operator
pow_spec
=
(
lambda
k
:
(.
05
/
(
k
+
1
)
**
3
))
pow_spec
=
(
lambda
k
:
(.
05
/
(
k
+
1
)
**
2
))
S
=
create_power_operator
(
h_space
,
power_spectrum
=
pow_spec
,
distribution_strategy
=
distribution_strategy
)
...
...
@@ -89,43 +79,11 @@ if __name__ == "__main__":
Instrument
=
DiagonalOperator
(
s_space
,
diagonal
=
1.
)
# Instrument._diagonal.val[200:400, 200:400] = 0
# Choosing nonlinearity
# log-normal model:
function
=
exp
derivative
=
exp
# tan-normal model
# def function(x):
# return 0.5 * tanh(x) + 0.5
# def derivative(x):
# return 0.5*(1 - tanh(x)**2)
# no nonlinearity, Wiener Filter
# def function(x):
# return x
# def derivative(x):
# return 1
# small quadratic pertubarion
# def function(x):
# return 0.5*x**2 + x
# def derivative(x):
# return x + 1
# def function(x):
# return 0.9*x**4 +0.2*x**2 + x
# def derivative(x):
# return 0.9*4*x**3 + 0.4*x +1
#
#Adding a harmonic transformation to the instrument
R
=
NonlinearResponse
(
fft
,
Instrument
,
function
,
derivative
)
noise
=
.
01
R
=
AdjointFFTResponse
(
fft
,
Instrument
)
noise
=
1.
N
=
DiagonalOperator
(
s_space
,
diagonal
=
noise
,
bare
=
True
)
n
=
Field
.
from_random
(
domain
=
s_space
,
random_type
=
'normal'
,
...
...
@@ -134,66 +92,64 @@ if __name__ == "__main__":
# Creating the mock data
d
=
R
(
sh
)
+
n
realized_power
=
log
(
sh
.
power_analyze
(
logarithmic
=
p_space
.
config
[
"logarithmic"
])
**
2
)
realized_power
=
log
(
sh
.
power_analyze
(
logarithmic
=
p_space
.
config
[
"logarithmic"
],
nbin
=
p_space
.
config
[
"nbin"
])
**
2
)
data_power
=
log
(
fft
(
d
).
power_analyze
(
logarithmic
=
p_space
.
config
[
"logarithmic"
],
nbin
=
p_space
.
config
[
"nbin"
])
**
2
)
d_data
=
d
.
val
.
get_full_data
().
real
if
rank
==
0
:
pl
.
plot
([
go
.
Heatmap
(
z
=
d_data
)],
filename
=
'data.html'
)
#
Choosing the
minimization strategy
# minimization strategy
def
convergence_measure
(
a_energy
,
iteration
):
# returns current energy
x
=
a_energy
.
value
print
(
x
,
iteration
)
# minimizer1 = SteepestDescent(convergence_tolerance=0,
# iteration_limit=50,
# callback=convergence_measure)
minimizer1
=
RelaxedNewton
(
convergence_tolerance
=
0
,
convergence_level
=
1
,
iteration_limit
=
5
,
iteration_limit
=
2
,
callback
=
convergence_measure
)
# minimizer2 = RelaxedNewton(convergence_tolerance=0,
# convergence_level=1,
# iteration_limit=2,
# callback=convergence_measure)
#
# minimizer1 = VL_BFGS(convergence_tolerance=0,
# iteration_limit=5,
# callback=convergence_measure,
# max_history_length=3)
minimizer2
=
VL_BFGS
(
convergence_tolerance
=
0
,
iteration_limit
=
50
,
callback
=
convergence_measure
,
max_history_length
=
3
)
# Setting starting position
flat_power
=
Field
(
p_space
,
val
=
10e-8
)
m0
=
flat_power
.
power_synthesize
(
real_signal
=
True
)
t0
=
Field
(
p_space
,
val
=
log
(
1.
/
(
1
+
p_space
.
kindex
)
**
2
))
# t0 = Field(p_space,val=-8)
# t0 = log(sp.copy()**2)
#t0 = data_power
S0
=
create_power_operator
(
h_space
,
power_spectrum
=
exp
(
t0
),
distribution_strategy
=
distribution_strategy
)
for
i
in
range
(
100
):
S0
=
create_power_operator
(
h_space
,
power_spectrum
=
exp
(
t0
),
distribution_strategy
=
distribution_strategy
)
# Initializing the nonlinear Wiener Filter energy
map_energy
=
Nonlinear
WienerFilterEnergy
(
position
=
m0
,
d
=
d
,
R
=
R
,
N
=
N
,
S
=
S0
)
map_energy
=
WienerFilterEnergy
(
position
=
m0
,
d
=
d
,
R
=
R
,
N
=
N
,
S
=
S0
)
# Minimization with chosen minimizer
(
map_energy
,
convergence
)
=
minimizer1
(
map_energy
)
map_energy
=
map_energy
.
analytic_solution
()
# Updating parameters for correlation structure reconstruction
m0
=
map_energy
.
position
D0
=
map_energy
.
curvature
# Initializing the power energy with updated parameters
power_energy
=
CriticalPowerEnergy
(
position
=
t0
,
m
=
m0
,
D
=
D0
,
sigma
=
10.
,
samples
=
3
)
(
power_energy
,
convergence
)
=
minimizer1
(
power_energy
)
if
i
>
0
:
(
power_energy
,
convergence
)
=
minimizer1
(
power_energy
)
else
:
(
power_energy
,
convergence
)
=
minimizer2
(
power_energy
)
# Setting new power spectrum
t0
=
power_energy
.
position
plot_parameters
(
m0
,
t0
,
log
(
sp
**
2
),
realized_power
)
t0
.
val
[
-
1
]
=
t0
.
val
[
-
2
]
# Plotting current estimate
plot_parameters
(
m0
,
t0
,
log
(
sp
**
2
),
realized_power
,
data_power
)
# Transforming fields to position space for plotting
...
...
@@ -223,10 +179,3 @@ if __name__ == "__main__":
m_data
=
m
.
val
.
get_full_data
().
real
if
rank
==
0
:
pl
.
plot
([
go
.
Heatmap
(
z
=
m_data
)],
filename
=
'map.html'
)
f_m_data
=
function
(
m
).
val
.
get_full_data
().
real
if
rank
==
0
:
pl
.
plot
([
go
.
Heatmap
(
z
=
f_m_data
)],
filename
=
'f_map.html'
)
f_ss_data
=
function
(
ss
).
val
.
get_full_data
().
real
if
rank
==
0
:
pl
.
plot
([
go
.
Heatmap
(
z
=
f_ss_data
)],
filename
=
'f_ss.html'
)
demos/laplace_testing.py
0 → 100644
View file @
10966a24
from
nifty
import
*
import
numpy
as
np
from
nifty
import
Field
,
\
EndomorphicOperator
,
\
PowerSpace
import
plotly.offline
as
pl
import
plotly.graph_objs
as
go
import
numpy
as
np
from
nifty
import
Field
,
\
EndomorphicOperator
,
\
PowerSpace
class
TestEnergy
(
Energy
):
def
__init__
(
self
,
position
,
Op
):
super
(
TestEnergy
,
self
).
__init__
(
position
)
self
.
Op
=
Op
def
at
(
self
,
position
):
return
self
.
__class__
(
position
=
position
,
Op
=
self
.
Op
)
@
property
def
value
(
self
):
return
0.5
*
self
.
position
.
dot
(
self
.
Op
(
self
.
position
))
@
property
def
gradient
(
self
):
return
self
.
Op
(
self
.
position
)
@
property
def
curvature
(
self
):
curv
=
CurvOp
(
self
.
Op
)
return
curv
class
CurvOp
(
InvertibleOperatorMixin
,
EndomorphicOperator
):
def
__init__
(
self
,
Op
,
inverter
=
None
,
preconditioner
=
None
):
self
.
Op
=
Op
self
.
_domain
=
Op
.
domain
super
(
CurvOp
,
self
).
__init__
(
inverter
=
inverter
,
preconditioner
=
preconditioner
)
def
_times
(
self
,
x
,
spaces
):
return
self
.
Op
(
x
)
if
__name__
==
"__main__"
:
distribution_strategy
=
'not'
# Set up position space
s_space
=
RGSpace
([
128
,
128
])
# s_space = HPSpace(32)
# Define harmonic transformation and associated harmonic space
fft
=
FFTOperator
(
s_space
)
h_space
=
fft
.
target
[
0
]
# Setting up power space
p_space
=
PowerSpace
(
h_space
,
logarithmic
=
False
,
distribution_strategy
=
distribution_strategy
,
nbin
=
16
)
# Choosing the prior correlation structure and defining correlation operator
pow_spec
=
(
lambda
k
:
(.
05
/
(
k
+
1
)
**
2
))
# t = Field(p_space, val=pow_spec)
t
=
Field
.
from_random
(
"normal"
,
domain
=
p_space
)
lap
=
LogLaplaceOperator
(
p_space
)
T
=
SmoothnessOperator
(
p_space
,
sigma
=
1.
)
test_energy
=
TestEnergy
(
t
,
T
)
def
convergence_measure
(
a_energy
,
iteration
):
# returns current energy
x
=
a_energy
.
value
print
(
x
,
iteration
)
minimizer1
=
VL_BFGS
(
convergence_tolerance
=
0
,
iteration_limit
=
1000
,
callback
=
convergence_measure
,
max_history_length
=
3
)
def
explicify
(
op
,
domain
):
space
=
domain
d
=
space
.
dim
res
=
np
.
zeros
((
d
,
d
))
for
i
in
range
(
d
):
x
=
np
.
zeros
(
d
)
x
[
i
]
=
1.
f
=
Field
(
space
,
val
=
x
)
res
[:,
i
]
=
op
(
f
).
val
return
res
A
=
explicify
(
lap
.
times
,
p_space
)
B
=
explicify
(
lap
.
adjoint_times
,
p_space
)
test_energy
,
convergence
=
minimizer1
(
test_energy
)
data
=
test_energy
.
position
.
val
.
get_full_data
()
pl
.
plot
([
go
.
Scatter
(
x
=
log
(
p_space
.
kindex
)[
1
:],
y
=
data
[
1
:])],
filename
=
"t.html"
)
tt
=
Field
.
from_random
(
"normal"
,
domain
=
t
.
domain
)
print
"adjointness"
print
t
.
dot
(
lap
(
tt
))
print
tt
.
dot
(
lap
.
adjoint_times
(
t
))
print
"log kindex"
aa
=
Field
(
p_space
,
val
=
p_space
.
kindex
.
copy
())
aa
.
val
[
0
]
=
1
print
lap
(
log
(
aa
)).
val
print
"######################"
print
test_energy
.
position
.
val
\ No newline at end of file
demos/nonlinear_wiener_filter.py
deleted
100644 → 0
View file @
3c0b82ce
from
nifty
import
*
import
plotly.offline
as
pl
import
plotly.graph_objs
as
go
from
mpi4py
import
MPI
comm
=
MPI
.
COMM_WORLD
rank
=
comm
.
rank
np
.
random
.
seed
(
42
)
class
NonlinearResponse
(
LinearOperator
):
def
__init__
(
self
,
FFT
,
Instrument
,
function
,
derivative
,
default_spaces
=
None
):
super
(
NonlinearResponse
,
self
).
__init__
(
default_spaces
)
self
.
_domain
=
FFT
.
target
self
.
_target
=
Instrument
.
target
self
.
function
=
function
self
.
derivative
=
derivative
self
.
I
=
Instrument
self
.
FFT
=
FFT
def
_times
(
self
,
x
,
spaces
=
None
):
return
self
.
I
(
self
.
function
(
self
.
FFT
.
adjoint_times
(
x
)))
def
_adjoint_times
(
self
,
x
,
spaces
=
None
):
return
self
.
FFT
(
self
.
function
(
self
.
I
.
adjoint_times
(
x
)))
def
derived_times
(
self
,
x
,
position
):
position_derivative
=
self
.
derivative
(
self
.
FFT
.
adjoint_times
(
position
))
return
self
.
I
(
position_derivative
*
self
.
FFT
.
adjoint_times
(
x
))
def
derived_adjoint_times
(
self
,
x
,
position
):
position_derivative
=
self
.
derivative
(
self
.
FFT
.
adjoint_times
(
position
))
return
self
.
FFT
(
position_derivative
*
self
.
I
.
adjoint_times
(
x
))
@
property
def
domain
(
self
):
return
self
.
_domain
@
property
def
target
(
self
):
return
self
.
_target
@
property
def
unitary
(
self
):
return
False
if
__name__
==
"__main__"
:
distribution_strategy
=
'not'
# Set up position space
s_space
=
RGSpace
([
100
,
100
])
# s_space = HPSpace(32)
# Define harmonic transformation and associated harmonic space
fft
=
FFTOperator
(
s_space
)
h_space
=
fft
.
target
[
0
]
# Setting up power space
p_space
=
PowerSpace
(
h_space
,
distribution_strategy
=
distribution_strategy
)
# Choosing the prior correlation structure and defining correlation operator
pow_spec
=
(
lambda
k
:
(
1.
/
(
k
+
1
)
**
3
))
S
=
create_power_operator
(
h_space
,
power_spectrum
=
pow_spec
,
distribution_strategy
=
distribution_strategy
)
# Drawing a sample sh from the prior distribution in harmonic space
sp
=
Field
(
p_space
,
val
=
lambda
z
:
pow_spec
(
z
)
**
(
1.
/
2
),
distribution_strategy
=
distribution_strategy
)
sh
=
sp
.
power_synthesize
(
real_signal
=
True
)
# Choosing the measurement instrument
# Instrument = SmoothingOperator(s_space, sigma=0.01)
Instrument
=
DiagonalOperator
(
s_space
,
diagonal
=
1.
)
# Instrument._diagonal.val[200:400, 200:400] = 0
# Choosing nonlinearity
#
# function = exp
# derivative = exp
def
function
(
x
):
return
0.5
*
tanh
(
x
)
+
0.5
def
derivative
(
x
):
return
0.5
*
(
1.
-
tanh
(
x
)
**
2
)
# def function(x):
# return 20*x
# def derivative(x):
# return 20.
# def function(x):
# return 0.1*0.5*x**2 + x
# def derivative(x):
# return 0.1*x + 1
# def function(x):
# return 0.9*x**4 +0.2*x**2 + x
# def derivative(x):
# return 0.9*4*x**3 + 0.4*x +1
#
#Adding a harmonic transformation to the instrument
noise
=
10.
N
=
DiagonalOperator
(
s_space
,
diagonal
=
noise
,
bare
=
True
)
n
=
Field
.
from_random
(
domain
=
s_space
,
random_type
=
'normal'
,
std
=
sqrt
(
noise
),
mean
=
0
)
R
=
NonlinearResponse
(
fft
,
Instrument
,
function
,
derivative
)
# Creating the mock data
d
=
R
(
sh
)
+
n
# Choosing the minimization strategy
def
convergence_measure
(
energy
,
iteration
):
# returns current energy
x
=
energy
.
value
print
(
x
,
iteration
)
# minimizer = SteepestDescent(convergence_tolerance=0,
# iteration_limit=50,
# callback=convergence_measure)
#
minimizer
=
RelaxedNewton
(
convergence_tolerance
=
0
,
convergence_level
=
1
,
iteration_limit
=
3
,
callback
=
convergence_measure
)
# minimizer = VL_BFGS(convergence_tolerance=0,
# iteration_limit=50,
# callback=convergence_measure,
# max_history_length=3)
#
# Setting starting position
flat_power
=
Field
(
p_space
,
val
=
10e-8
)
m0
=
flat_power
.
power_synthesize
(
real_signal
=
True
)
# Initializing the Wiener Filter energy
energy
=
NonlinearWienerFilterEnergy
(
position
=
m0
,
d
=
d
,
R
=
R
,
N
=
N
,
S
=
S
)
# Solving the problem with chosen minimization strategy
(
energy
,
convergence
)
=
minimizer
(
energy
)
# Transforming fields to position space for plotting
ss
=
fft
.
adjoint_times
(
sh
)
m
=
fft
.
adjoint_times
(
energy
.
position
)
# Plotting
d_data
=
d
.
val
.
get_full_data
().
real
if
rank
==
0
:
pl
.
plot
([
go
.
Heatmap
(
z
=
d_data
)],
filename
=
'data.html'
)
ss_data
=
ss
.
val
.
get_full_data
().
real
if
rank
==
0
:
pl
.
plot
([
go
.
Heatmap
(
z
=
ss_data
)],
filename
=
'ss.html'
)
sh_data
=
sh
.
val
.
get_full_data
().
real
if
rank
==
0
:
pl
.
plot
([
go
.
Heatmap
(
z
=
sh_data
)],
filename
=
'sh.html'
)
m_data
=
m
.
val
.
get_full_data
().
real
if
rank
==
0
:
pl
.
plot
([
go
.
Heatmap
(
z
=
m_data
)],
filename
=
'map.html'
)
f_m_data
=
function
(
m
).
val
.
get_full_data
().
real
if
rank
==
0
:
pl
.
plot
([
go
.
Heatmap
(
z
=
f_m_data
)],
filename
=
'f_map.html'
)
f_ss_data
=
function
(
ss
).
val
.
get_full_data
().
real
if
rank
==
0
:
pl
.
plot
([
go
.
Heatmap
(
z
=
f_ss_data
)],
filename
=
'f_ss.html'
)
demos/train_example.py
View file @
10966a24
...
...
@@ -54,12 +54,36 @@ def plot_parameters(m,t, t_real):
pl
.
plot
([
go
.
Scatter
(
y
=
m_data
)],
filename
=
'map.html'
)
pl
.
plot
([
go
.
Scatter
(
y
=
t_data
),
go
.
Scatter
(
y
=
t_real_data
)],
filename
=
"t.html"
)
class
AdjointFFTResponse
(
LinearOperator
):
def
__init__
(
self
,
FFT
,
R
,
default_spaces
=
None
):
super
(
AdjointFFTResponse
,
self
).
__init__
(
default_spaces
)
self
.
_domain
=
FFT
.
target
self
.
_target
=
R
.
target
self
.
R
=
R
self
.
FFT
=
FFT
def
_times
(
self
,
x
,
spaces
=
None
):
return
self
.
R
(
self
.
FFT
.
adjoint_times
(
x
))
def
_adjoint_times
(
self
,
x
,
spaces
=
None
):
return
self
.
FFT
(
self
.
R
.
adjoint_times
(
x
))
@
property
def
domain
(
self
):
return
self
.
_domain
@
property
def
target
(
self
):
return
self
.
_target
@
property
def
unitary
(
self
):
return
False
if
__name__
==
"__main__"
:
distribution_strategy
=
'not'
full_data
=
np
.
genfromtxt
(
"train_data.csv"
,
delimiter
=
','
)
d
=
full_data
.
T
[
2
]
d
=
full_data
.
T
[
3
]
d
[
0
]
=
0.
d
-=
d
.
mean
()
d
[
0
]
=
0.
...
...
@@ -80,42 +104,9 @@ if __name__ == "__main__":
Instrument
=
DiagonalOperator
(
s_space
,
diagonal
=
1.
)
# Instrument._diagonal.val[200:400, 200:400] = 0
# Choosing nonlinearity
# log-normal model:
# function = exp
# derivative = exp
# tan-normal model
# def function(x):
# return 0.5 * tanh(x) + 0.5
# def derivative(x):
# return 0.5*(1 - tanh(x)**2)
# no nonlinearity, Wiener Filter
def
function
(
x
):
return
x
def
derivative
(
x
):
return
1
# small quadratic pertubarion
# def function(x):
# return 0.5*x**2 + x
# def derivative(x):
# return x + 1
# def function(x):
# return 0.9*x**4 +0.2*x**2 + x
# def derivative(x):
# return 0.9*4*x**3 + 0.4*x +1
#
#Adding a harmonic transformation to the instrument
R
=
Nonlinear
Response
(
fft
,
Instrument
,
function
,
derivative
)
R
=
AdjointFFT
Response
(
fft
,
Instrument
)
noise
=
.
1
N
=
DiagonalOperator
(
s_space
,
diagonal
=
noise
,
bare
=
True
)
...
...
@@ -139,13 +130,13 @@ if __name__ == "__main__":
callback
=
convergence_measure
)
minimizer2
=
RelaxedNewton
(
convergence_tolerance
=
0
,
convergence_level
=
1
,