Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NIFTy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
13
Merge Requests
13
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ift
NIFTy
Commits
ec41028a
Commit
ec41028a
authored
Aug 31, 2017
by
Martin Reinecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revert operator copy
parent
66c00558
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
17 additions
and
194 deletions
+17
-194
nifty/library/critical_filter/critical_power_curvature.py
nifty/library/critical_filter/critical_power_curvature.py
+0
-17
nifty/library/critical_filter/critical_power_energy.py
nifty/library/critical_filter/critical_power_energy.py
+5
-16
nifty/library/log_normal_wiener_filter/log_normal_wiener_filter_curvature.py
...ormal_wiener_filter/log_normal_wiener_filter_curvature.py
+0
-17
nifty/library/log_normal_wiener_filter/log_normal_wiener_filter_energy.py
...g_normal_wiener_filter/log_normal_wiener_filter_energy.py
+6
-19
nifty/library/wiener_filter/wiener_filter_curvature.py
nifty/library/wiener_filter/wiener_filter_curvature.py
+0
-9
nifty/library/wiener_filter/wiener_filter_energy.py
nifty/library/wiener_filter/wiener_filter_energy.py
+4
-8
nifty/operators/composed_operator/composed_operator.py
nifty/operators/composed_operator/composed_operator.py
+0
-8
nifty/operators/diagonal_operator/diagonal_operator.py
nifty/operators/diagonal_operator/diagonal_operator.py
+1
-11
nifty/operators/fft_operator/fft_operator.py
nifty/operators/fft_operator/fft_operator.py
+0
-9
nifty/operators/invertible_operator_mixin/invertible_operator_mixin.py
...rs/invertible_operator_mixin/invertible_operator_mixin.py
+0
-17
nifty/operators/laplace_operator/laplace_operator.py
nifty/operators/laplace_operator/laplace_operator.py
+0
-9
nifty/operators/linear_operator/linear_operator.py
nifty/operators/linear_operator/linear_operator.py
+0
-14
nifty/operators/projection_operator/projection_operator.py
nifty/operators/projection_operator/projection_operator.py
+0
-7
nifty/operators/response_operator/response_operator.py
nifty/operators/response_operator/response_operator.py
+1
-10
nifty/operators/smoothing_operator/direct_smoothing_operator.py
...operators/smoothing_operator/direct_smoothing_operator.py
+0
-7
nifty/operators/smoothing_operator/fft_smoothing_operator.py
nifty/operators/smoothing_operator/fft_smoothing_operator.py
+0
-7
nifty/operators/smoothness_operator/smoothness_operator.py
nifty/operators/smoothness_operator/smoothness_operator.py
+0
-9
No files found.
nifty/library/critical_filter/critical_power_curvature.py
View file @
ec41028a
...
@@ -33,23 +33,6 @@ class CriticalPowerCurvature(InvertibleOperatorMixin, EndomorphicOperator):
...
@@ -33,23 +33,6 @@ class CriticalPowerCurvature(InvertibleOperatorMixin, EndomorphicOperator):
preconditioner
=
preconditioner
,
preconditioner
=
preconditioner
,
**
kwargs
)
**
kwargs
)
def
_add_attributes_to_copy
(
self
,
copy
,
**
kwargs
):
copy
.
_domain
=
self
.
_domain
if
'theta'
in
kwargs
:
theta
=
kwargs
[
'theta'
]
copy
.
theta
=
DiagonalOperator
(
theta
.
domain
,
diagonal
=
theta
)
else
:
copy
.
theta
=
self
.
theta
.
copy
()
if
'T'
in
kwargs
:
copy
.
T
=
kwargs
[
'T'
]
else
:
copy
.
T
=
self
.
T
copy
=
super
(
CriticalPowerCurvature
,
self
).
_add_attributes_to_copy
(
copy
,
**
kwargs
)
return
copy
def
_times
(
self
,
x
,
spaces
):
def
_times
(
self
,
x
,
spaces
):
return
self
.
T
(
x
)
+
self
.
theta
(
x
)
return
self
.
T
(
x
)
+
self
.
theta
(
x
)
...
...
nifty/library/critical_filter/critical_power_energy.py
View file @
ec41028a
...
@@ -54,8 +54,7 @@ class CriticalPowerEnergy(Energy):
...
@@ -54,8 +54,7 @@ class CriticalPowerEnergy(Energy):
# ---Overwritten properties and methods---
# ---Overwritten properties and methods---
def
__init__
(
self
,
position
,
m
,
D
=
None
,
alpha
=
1.0
,
q
=
0.
,
def
__init__
(
self
,
position
,
m
,
D
=
None
,
alpha
=
1.0
,
q
=
0.
,
smoothness_prior
=
0.
,
logarithmic
=
True
,
samples
=
3
,
w
=
None
,
smoothness_prior
=
0.
,
logarithmic
=
True
,
samples
=
3
,
w
=
None
):
old_curvature
=
None
):
super
(
CriticalPowerEnergy
,
self
).
__init__
(
position
=
position
)
super
(
CriticalPowerEnergy
,
self
).
__init__
(
position
=
position
)
self
.
m
=
m
self
.
m
=
m
self
.
D
=
D
self
.
D
=
D
...
@@ -67,8 +66,6 @@ class CriticalPowerEnergy(Energy):
...
@@ -67,8 +66,6 @@ class CriticalPowerEnergy(Energy):
logarithmic
=
logarithmic
)
logarithmic
=
logarithmic
)
self
.
rho
=
self
.
position
.
domain
[
0
].
rho
self
.
rho
=
self
.
position
.
domain
[
0
].
rho
self
.
_w
=
w
if
w
is
not
None
else
None
self
.
_w
=
w
if
w
is
not
None
else
None
self
.
_old_curvature
=
old_curvature
self
.
_curvature
=
None
# ---Mandatory properties and methods---
# ---Mandatory properties and methods---
...
@@ -76,11 +73,9 @@ class CriticalPowerEnergy(Energy):
...
@@ -76,11 +73,9 @@ class CriticalPowerEnergy(Energy):
return
self
.
__class__
(
position
,
self
.
m
,
D
=
self
.
D
,
alpha
=
self
.
alpha
,
return
self
.
__class__
(
position
,
self
.
m
,
D
=
self
.
D
,
alpha
=
self
.
alpha
,
q
=
self
.
q
,
smoothness_prior
=
self
.
smoothness_prior
,
q
=
self
.
q
,
smoothness_prior
=
self
.
smoothness_prior
,
logarithmic
=
self
.
logarithmic
,
logarithmic
=
self
.
logarithmic
,
w
=
self
.
w
,
samples
=
self
.
samples
,
w
=
self
.
w
,
samples
=
self
.
samples
)
old_curvature
=
self
.
_curvature
)
@
property
@
property
@
memo
def
value
(
self
):
def
value
(
self
):
energy
=
self
.
_theta
.
sum
()
energy
=
self
.
_theta
.
sum
()
energy
+=
self
.
position
.
vdot
(
self
.
_rho_prime
,
bare
=
True
)
energy
+=
self
.
position
.
vdot
(
self
.
_rho_prime
,
bare
=
True
)
...
@@ -88,7 +83,6 @@ class CriticalPowerEnergy(Energy):
...
@@ -88,7 +83,6 @@ class CriticalPowerEnergy(Energy):
return
energy
.
real
return
energy
.
real
@
property
@
property
@
memo
def
gradient
(
self
):
def
gradient
(
self
):
gradient
=
-
self
.
_theta
.
weight
(
-
1
)
gradient
=
-
self
.
_theta
.
weight
(
-
1
)
gradient
+=
(
self
.
_rho_prime
).
weight
(
-
1
)
gradient
+=
(
self
.
_rho_prime
).
weight
(
-
1
)
...
@@ -98,14 +92,9 @@ class CriticalPowerEnergy(Energy):
...
@@ -98,14 +92,9 @@ class CriticalPowerEnergy(Energy):
@
property
@
property
def
curvature
(
self
):
def
curvature
(
self
):
if
self
.
_curvature
is
None
:
curvature
=
CriticalPowerCurvature
(
theta
=
self
.
_theta
.
weight
(
-
1
),
if
self
.
_old_curvature
is
None
:
T
=
self
.
T
)
self
.
_curvature
=
CriticalPowerCurvature
(
return
curvature
theta
=
self
.
_theta
.
weight
(
-
1
),
T
=
self
.
T
)
else
:
self
.
_curvature
=
self
.
_old_curvature
.
copy
(
theta
=
self
.
_theta
.
weight
(
-
1
),
T
=
self
.
T
)
return
self
.
_curvature
# ---Added properties and methods---
# ---Added properties and methods---
...
...
nifty/library/log_normal_wiener_filter/log_normal_wiener_filter_curvature.py
View file @
ec41028a
...
@@ -48,23 +48,6 @@ class LogNormalWienerFilterCurvature(InvertibleOperatorMixin,
...
@@ -48,23 +48,6 @@ class LogNormalWienerFilterCurvature(InvertibleOperatorMixin,
preconditioner
=
preconditioner
,
preconditioner
=
preconditioner
,
**
kwargs
)
**
kwargs
)
def
_add_attributes_to_copy
(
self
,
copy
,
**
kwargs
):
copy
.
_cache
=
{}
copy
.
_domain
=
self
.
_domain
copy
.
R
=
self
.
R
.
copy
()
copy
.
N
=
self
.
N
.
copy
()
copy
.
S
=
self
.
S
.
copy
()
copy
.
d
=
self
.
d
.
copy
()
if
'position'
in
kwargs
:
copy
.
position
=
kwargs
[
'position'
]
else
:
copy
.
position
=
self
.
position
.
copy
()
copy
.
_fft
=
self
.
_fft
copy
=
super
(
LogNormalWienerFilterCurvature
,
self
).
_add_attributes_to_copy
(
copy
,
**
kwargs
)
return
copy
@
property
@
property
def
domain
(
self
):
def
domain
(
self
):
return
self
.
_domain
return
self
.
_domain
...
...
nifty/library/log_normal_wiener_filter/log_normal_wiener_filter_energy.py
View file @
ec41028a
...
@@ -24,7 +24,7 @@ class LogNormalWienerFilterEnergy(Energy):
...
@@ -24,7 +24,7 @@ class LogNormalWienerFilterEnergy(Energy):
The prior signal covariance in harmonic space.
The prior signal covariance in harmonic space.
"""
"""
def
__init__
(
self
,
position
,
d
,
R
,
N
,
S
,
fft4exp
=
None
,
old_curvature
=
None
):
def
__init__
(
self
,
position
,
d
,
R
,
N
,
S
,
fft4exp
=
None
):
super
(
LogNormalWienerFilterEnergy
,
self
).
__init__
(
position
=
position
)
super
(
LogNormalWienerFilterEnergy
,
self
).
__init__
(
position
=
position
)
self
.
d
=
d
self
.
d
=
d
self
.
R
=
R
self
.
R
=
R
...
@@ -37,13 +37,9 @@ class LogNormalWienerFilterEnergy(Energy):
...
@@ -37,13 +37,9 @@ class LogNormalWienerFilterEnergy(Energy):
else
:
else
:
self
.
_fft
=
fft4exp
self
.
_fft
=
fft4exp
self
.
_old_curvature
=
old_curvature
self
.
_curvature
=
None
def
at
(
self
,
position
):
def
at
(
self
,
position
):
return
self
.
__class__
(
position
=
position
,
d
=
self
.
d
,
R
=
self
.
R
,
N
=
self
.
N
,
return
self
.
__class__
(
position
=
position
,
d
=
self
.
d
,
R
=
self
.
R
,
N
=
self
.
N
,
S
=
self
.
S
,
fft4exp
=
self
.
_fft
,
S
=
self
.
S
,
fft4exp
=
self
.
_fft
)
old_curvature
=
self
.
_curvature
)
@
property
@
property
@
memo
@
memo
...
@@ -57,20 +53,11 @@ class LogNormalWienerFilterEnergy(Energy):
...
@@ -57,20 +53,11 @@ class LogNormalWienerFilterEnergy(Energy):
return
self
.
_Sp
+
self
.
_exppRNRexppd
return
self
.
_Sp
+
self
.
_exppRNRexppd
@
property
@
property
@
memo
def
curvature
(
self
):
def
curvature
(
self
):
if
self
.
_curvature
is
None
:
return
LogNormalWienerFilterCurvature
(
R
=
self
.
R
,
N
=
self
.
N
,
S
=
self
.
S
,
if
self
.
_old_curvature
is
None
:
d
=
self
.
d
,
position
=
self
.
position
,
self
.
_curvature
=
LogNormalWienerFilterCurvature
(
fft4exp
=
self
.
_fft
)
R
=
self
.
R
,
N
=
self
.
N
,
S
=
self
.
S
,
d
=
self
.
d
,
position
=
self
.
position
,
fft4exp
=
self
.
_fft
)
else
:
self
.
_curvature
=
\
self
.
_old_curvature
.
copy
(
position
=
self
.
position
)
return
self
.
_curvature
@
property
@
property
def
_expp
(
self
):
def
_expp
(
self
):
...
...
nifty/library/wiener_filter/wiener_filter_curvature.py
View file @
ec41028a
...
@@ -35,15 +35,6 @@ class WienerFilterCurvature(InvertibleOperatorMixin, EndomorphicOperator):
...
@@ -35,15 +35,6 @@ class WienerFilterCurvature(InvertibleOperatorMixin, EndomorphicOperator):
preconditioner
=
preconditioner
,
preconditioner
=
preconditioner
,
**
kwargs
)
**
kwargs
)
def
_add_attributes_to_copy
(
self
,
copy
,
**
kwargs
):
copy
.
_domain
=
self
.
_domain
copy
.
R
=
self
.
R
.
copy
()
copy
.
N
=
self
.
N
.
copy
()
copy
.
S
=
self
.
S
.
copy
()
copy
=
super
(
WienerFilterCurvature
,
self
).
_add_attributes_to_copy
(
copy
,
**
kwargs
)
return
copy
@
property
@
property
def
domain
(
self
):
def
domain
(
self
):
return
self
.
_domain
return
self
.
_domain
...
...
nifty/library/wiener_filter/wiener_filter_energy.py
View file @
ec41028a
...
@@ -23,17 +23,16 @@ class WienerFilterEnergy(Energy):
...
@@ -23,17 +23,16 @@ class WienerFilterEnergy(Energy):
The prior signal covariance in harmonic space.
The prior signal covariance in harmonic space.
"""
"""
def
__init__
(
self
,
position
,
d
,
R
,
N
,
S
,
old_curvature
=
None
):
def
__init__
(
self
,
position
,
d
,
R
,
N
,
S
):
super
(
WienerFilterEnergy
,
self
).
__init__
(
position
=
position
)
super
(
WienerFilterEnergy
,
self
).
__init__
(
position
=
position
)
self
.
d
=
d
self
.
d
=
d
self
.
R
=
R
self
.
R
=
R
self
.
N
=
N
self
.
N
=
N
self
.
S
=
S
self
.
S
=
S
self
.
_curvature
=
old_curvature
def
at
(
self
,
position
):
def
at
(
self
,
position
):
return
self
.
__class__
(
position
=
position
,
d
=
self
.
d
,
R
=
self
.
R
,
N
=
self
.
N
,
return
self
.
__class__
(
position
=
position
,
d
=
self
.
d
,
R
=
self
.
R
,
N
=
self
.
N
,
S
=
self
.
S
,
old_curvature
=
self
.
curvature
)
S
=
self
.
S
)
@
property
@
property
@
memo
@
memo
...
@@ -46,12 +45,9 @@ class WienerFilterEnergy(Energy):
...
@@ -46,12 +45,9 @@ class WienerFilterEnergy(Energy):
return
self
.
_Dx
-
self
.
_j
return
self
.
_Dx
-
self
.
_j
@
property
@
property
@
memo
def
curvature
(
self
):
def
curvature
(
self
):
if
self
.
_curvature
is
None
:
return
WienerFilterCurvature
(
R
=
self
.
R
,
N
=
self
.
N
,
S
=
self
.
S
)
self
.
_curvature
=
WienerFilterCurvature
(
R
=
self
.
R
,
N
=
self
.
N
,
S
=
self
.
S
)
return
self
.
_curvature
@
property
@
property
@
memo
@
memo
...
...
nifty/operators/composed_operator/composed_operator.py
View file @
ec41028a
...
@@ -85,14 +85,6 @@ class ComposedOperator(LinearOperator):
...
@@ -85,14 +85,6 @@ class ComposedOperator(LinearOperator):
"instances of the LinearOperator-baseclass"
)
"instances of the LinearOperator-baseclass"
)
self
.
_operator_store
+=
(
op
,)
self
.
_operator_store
+=
(
op
,)
def
_add_attributes_to_copy
(
self
,
copy
,
**
kwargs
):
copy
.
_operator_store
=
()
for
op
in
self
.
_operator_store
:
copy
.
_operator_store
+=
(
op
.
copy
(),)
copy
=
super
(
ComposedOperator
,
self
).
_add_attributes_to_copy
(
copy
,
**
kwargs
)
return
copy
def
_check_input_compatibility
(
self
,
x
,
spaces
,
inverse
=
False
):
def
_check_input_compatibility
(
self
,
x
,
spaces
,
inverse
=
False
):
"""
"""
The input check must be disabled for the ComposedOperator, since it
The input check must be disabled for the ComposedOperator, since it
...
...
nifty/operators/diagonal_operator/diagonal_operator.py
View file @
ec41028a
...
@@ -90,15 +90,6 @@ class DiagonalOperator(EndomorphicOperator):
...
@@ -90,15 +90,6 @@ class DiagonalOperator(EndomorphicOperator):
self
.
_unitary
=
None
self
.
_unitary
=
None
self
.
set_diagonal
(
diagonal
=
diagonal
,
bare
=
bare
,
copy
=
copy
)
self
.
set_diagonal
(
diagonal
=
diagonal
,
bare
=
bare
,
copy
=
copy
)
def
_add_attributes_to_copy
(
self
,
copy
,
**
kwargs
):
copy
.
_domain
=
self
.
_domain
copy
.
set_diagonal
(
diagonal
=
self
.
diagonal
(
bare
=
True
),
bare
=
True
)
copy
.
_self_adjoint
=
self
.
_self_adjoint
copy
.
_unitary
=
self
.
_unitary
copy
=
super
(
DiagonalOperator
,
self
).
_add_attributes_to_copy
(
copy
,
**
kwargs
)
return
copy
def
_times
(
self
,
x
,
spaces
):
def
_times
(
self
,
x
,
spaces
):
return
self
.
_times_helper
(
x
,
spaces
,
operation
=
lambda
z
:
z
.
__mul__
)
return
self
.
_times_helper
(
x
,
spaces
,
operation
=
lambda
z
:
z
.
__mul__
)
...
@@ -107,8 +98,7 @@ class DiagonalOperator(EndomorphicOperator):
...
@@ -107,8 +98,7 @@ class DiagonalOperator(EndomorphicOperator):
operation
=
lambda
z
:
z
.
adjoint
().
__mul__
)
operation
=
lambda
z
:
z
.
adjoint
().
__mul__
)
def
_inverse_times
(
self
,
x
,
spaces
):
def
_inverse_times
(
self
,
x
,
spaces
):
return
self
.
_times_helper
(
return
self
.
_times_helper
(
x
,
spaces
,
operation
=
lambda
z
:
z
.
__rtruediv__
)
x
,
spaces
,
operation
=
lambda
z
:
z
.
__rtruediv__
)
def
_adjoint_inverse_times
(
self
,
x
,
spaces
):
def
_adjoint_inverse_times
(
self
,
x
,
spaces
):
return
self
.
_times_helper
(
x
,
spaces
,
return
self
.
_times_helper
(
x
,
spaces
,
...
...
nifty/operators/fft_operator/fft_operator.py
View file @
ec41028a
...
@@ -125,15 +125,6 @@ class FFTOperator(LinearOperator):
...
@@ -125,15 +125,6 @@ class FFTOperator(LinearOperator):
self
.
_backward_transformation
=
backward_class
(
self
.
_backward_transformation
=
backward_class
(
self
.
target
[
0
],
self
.
domain
[
0
])
self
.
target
[
0
],
self
.
domain
[
0
])
def
_add_attributes_to_copy
(
self
,
copy
,
**
kwargs
):
copy
.
_domain
=
self
.
_domain
copy
.
_target
=
self
.
_target
copy
.
_forward_transformation
=
self
.
_forward_transformation
copy
.
_backward_transformation
=
self
.
_backward_transformation
copy
=
super
(
FFTOperator
,
self
).
_add_attributes_to_copy
(
copy
,
**
kwargs
)
return
copy
def
_times
(
self
,
x
,
spaces
):
def
_times
(
self
,
x
,
spaces
):
spaces
=
utilities
.
cast_axis_to_tuple
(
spaces
,
len
(
x
.
domain
))
spaces
=
utilities
.
cast_axis_to_tuple
(
spaces
,
len
(
x
.
domain
))
if
spaces
is
None
:
if
spaces
is
None
:
...
...
nifty/operators/invertible_operator_mixin/invertible_operator_mixin.py
View file @
ec41028a
...
@@ -57,23 +57,6 @@ class InvertibleOperatorMixin(object):
...
@@ -57,23 +57,6 @@ class InvertibleOperatorMixin(object):
self
.
__backward_x0
=
backward_x0
self
.
__backward_x0
=
backward_x0
super
(
InvertibleOperatorMixin
,
self
).
__init__
(
*
args
,
**
kwargs
)
super
(
InvertibleOperatorMixin
,
self
).
__init__
(
*
args
,
**
kwargs
)
def
_add_attributes_to_copy
(
self
,
copy
,
**
kwargs
):
copy
.
__preconditioner
=
self
.
__preconditioner
copy
.
__inverter
=
self
.
__inverter
try
:
copy
.
__forward_x0
=
self
.
__forward_x0
.
copy
()
except
AttributeError
:
copy
.
__forward_x0
=
self
.
__forward_x0
try
:
copy
.
__backward_x0
=
self
.
__backward_x0
.
copy
()
except
AttributeError
:
copy
.
__backward_x0
=
self
.
__backward_x0
copy
=
super
(
InvertibleOperatorMixin
,
self
).
_add_attributes_to_copy
(
copy
,
**
kwargs
)
return
copy
def
_times
(
self
,
x
,
spaces
):
def
_times
(
self
,
x
,
spaces
):
if
self
.
__forward_x0
is
not
None
:
if
self
.
__forward_x0
is
not
None
:
x0
=
self
.
__forward_x0
x0
=
self
.
__forward_x0
...
...
nifty/operators/laplace_operator/laplace_operator.py
View file @
ec41028a
...
@@ -64,15 +64,6 @@ class LaplaceOperator(EndomorphicOperator):
...
@@ -64,15 +64,6 @@ class LaplaceOperator(EndomorphicOperator):
self
.
_dposc
[
1
:]
+=
self
.
_dpos
self
.
_dposc
[
1
:]
+=
self
.
_dpos
self
.
_dposc
*=
0.5
self
.
_dposc
*=
0.5
def
_add_attributes_to_copy
(
self
,
copy
,
**
kwargs
):
copy
.
_domain
=
self
.
_domain
copy
.
_logarithmic
=
self
.
_logarithmic
copy
.
_dpos
=
self
.
_dpos
copy
.
_dposc
=
self
.
_dposc
copy
=
super
(
LaplaceOperator
,
self
).
_add_attributes_to_copy
(
copy
,
**
kwargs
)
return
copy
@
property
@
property
def
target
(
self
):
def
target
(
self
):
return
self
.
_domain
return
self
.
_domain
...
...
nifty/operators/linear_operator/linear_operator.py
View file @
ec41028a
...
@@ -70,20 +70,6 @@ class LinearOperator(with_metaclass(
...
@@ -70,20 +70,6 @@ class LinearOperator(with_metaclass(
def
__init__
(
self
,
default_spaces
=
None
):
def
__init__
(
self
,
default_spaces
=
None
):
self
.
_default_spaces
=
default_spaces
self
.
_default_spaces
=
default_spaces
def
copy
(
self
,
**
kwargs
):
class
EmptyCopy
(
self
.
__class__
):
def
__init__
(
self
):
pass
result
=
EmptyCopy
()
result
.
__class__
=
self
.
__class__
result
=
self
.
_add_attributes_to_copy
(
result
,
**
kwargs
)
return
result
def
_add_attributes_to_copy
(
self
,
copy
,
**
kwargs
):
copy
.
_default_spaces
=
self
.
default_spaces
return
copy
@
staticmethod
@
staticmethod
def
_parse_domain
(
domain
):
def
_parse_domain
(
domain
):
return
utilities
.
parse_domain
(
domain
)
return
utilities
.
parse_domain
(
domain
)
...
...
nifty/operators/projection_operator/projection_operator.py
View file @
ec41028a
...
@@ -87,13 +87,6 @@ class ProjectionOperator(EndomorphicOperator):
...
@@ -87,13 +87,6 @@ class ProjectionOperator(EndomorphicOperator):
self
.
_projection_field
=
projection_field
self
.
_projection_field
=
projection_field
self
.
_unitary
=
None
self
.
_unitary
=
None
def
_add_attributes_to_copy
(
self
,
copy
,
**
kwargs
):
copy
.
_projection_field
=
self
.
_projection_field
copy
.
_unitary
=
self
.
_unitary
copy
=
super
(
ProjectionOperator
,
self
).
_add_attributes_to_copy
(
copy
,
**
kwargs
)
return
copy
def
_times
(
self
,
x
,
spaces
):
def
_times
(
self
,
x
,
spaces
):
# if the domain matches directly
# if the domain matches directly
# -> multiply the fields directly
# -> multiply the fields directly
...
...
nifty/operators/response_operator/response_operator.py
View file @
ec41028a
...
@@ -61,7 +61,7 @@ class ResponseOperator(LinearOperator):
...
@@ -61,7 +61,7 @@ class ResponseOperator(LinearOperator):
for
ii
in
range
(
len
(
kernel_smoothing
)):
for
ii
in
range
(
len
(
kernel_smoothing
)):
kernel_smoothing
[
ii
]
=
FFTSmoothingOperator
(
self
.
_domain
[
ii
],
kernel_smoothing
[
ii
]
=
FFTSmoothingOperator
(
self
.
_domain
[
ii
],
sigma
=
sigma
[
ii
])
sigma
=
sigma
[
ii
])
kernel_exposure
[
ii
]
=
DiagonalOperator
(
self
.
_domain
[
ii
],
kernel_exposure
[
ii
]
=
DiagonalOperator
(
self
.
_domain
[
ii
],
diagonal
=
exposure
[
ii
])
diagonal
=
exposure
[
ii
])
...
@@ -74,15 +74,6 @@ class ResponseOperator(LinearOperator):
...
@@ -74,15 +74,6 @@ class ResponseOperator(LinearOperator):
self
.
_target
=
self
.
_parse_domain
(
target_list
)
self
.
_target
=
self
.
_parse_domain
(
target_list
)
def
_add_attributes_to_copy
(
self
,
copy
,
**
kwargs
):
copy
.
_domain
=
self
.
_domain
copy
.
_target
=
self
.
_target
copy
.
_composed_kernel
=
self
.
_composed_kernel
.
copy
()
copy
.
_composed_exposure
=
self
.
_composed_exposure
.
copy
()
copy
=
super
(
DiagonalOperator
,
self
).
_add_attributes_to_copy
(
copy
,
**
kwargs
)
return
copy
@
property
@
property
def
domain
(
self
):
def
domain
(
self
):
return
self
.
_domain
return
self
.
_domain
...
...
nifty/operators/smoothing_operator/direct_smoothing_operator.py
View file @
ec41028a
...
@@ -57,13 +57,6 @@ class DirectSmoothingOperator(EndomorphicOperator):
...
@@ -57,13 +57,6 @@ class DirectSmoothingOperator(EndomorphicOperator):
def
log_distances
(
self
):
def
log_distances
(
self
):
return
self
.
_log_distances
return
self
.
_log_distances
def
_add_attributes_to_copy
(
self
,
copy
,
**
kwargs
):
copy
.
effective_smoothing_width
=
self
.
effective_smoothing_width
copy
=
super
(
DirectSmoothingOperator
,
self
).
_add_attributes_to_copy
(
copy
,
**
kwargs
)
return
copy
def
_precompute
(
self
,
x
,
sigma
,
dxmax
=
None
):
def
_precompute
(
self
,
x
,
sigma
,
dxmax
=
None
):
""" Does precomputations for Gaussian smoothing on a 1D irregular grid.
""" Does precomputations for Gaussian smoothing on a 1D irregular grid.
...
...
nifty/operators/smoothing_operator/fft_smoothing_operator.py
View file @
ec41028a
...
@@ -53,13 +53,6 @@ class FFTSmoothingOperator(EndomorphicOperator):
...
@@ -53,13 +53,6 @@ class FFTSmoothingOperator(EndomorphicOperator):
def
sigma
(
self
):
def
sigma
(
self
):
return
self
.
_sigma
return
self
.
_sigma
def
_add_attributes_to_copy
(
self
,
copy
,
**
kwargs
):
copy
.
_transformator_cache
=
self
.
_transformator_cache
copy
=
super
(
FFTSmoothingOperator
,
self
).
_add_attributes_to_copy
(
copy
,
**
kwargs
)
return
copy
def
_smooth
(
self
,
x
,
spaces
):
def
_smooth
(
self
,
x
,
spaces
):
# transform to the (global-)default codomain and perform all remaining
# transform to the (global-)default codomain and perform all remaining
# steps therein
# steps therein
...
...
nifty/operators/smoothness_operator/smoothness_operator.py
View file @
ec41028a
...
@@ -48,15 +48,6 @@ class SmoothnessOperator(EndomorphicOperator):
...
@@ -48,15 +48,6 @@ class SmoothnessOperator(EndomorphicOperator):
self
.
_laplace
=
LaplaceOperator
(
domain
=
self
.
domain
,
self
.
_laplace
=
LaplaceOperator
(
domain
=
self
.
domain
,
logarithmic
=
logarithmic
)
logarithmic
=
logarithmic
)
def
_add_attributes_to_copy
(
self
,
copy
,
**
kwargs
):
copy
.
_domain
=
self
.
_domain
copy
.
_strength
=
self
.
_strength
copy
.
_laplace
=
self
.
_laplace
.
copy
()
copy
=
super
(
SmoothnessOperator
,
self
).
_add_attributes_to_copy
(
copy
,
**
kwargs
)
return
copy
# ---Mandatory properties and methods---
# ---Mandatory properties and methods---
@
property
@
property
...
...
Write
Preview
Markdown
is supported
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