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
On Thursday, 7th July from 1 to 3 pm there will be a maintenance with a short downtime of GitLab.
Open sidebar
ift
NIFTy
Commits
ecdcd3a6
Commit
ecdcd3a6
authored
Jun 13, 2018
by
Philipp Arras
Browse files
Renaming and cleanup
parent
694ca42a
Pipeline
#30796
passed with stages
in 1 minute and 28 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
demos/sampling_demo.py
View file @
ecdcd3a6
...
...
@@ -43,7 +43,7 @@ D_inv_1 = ift.SamplingEnabler(ift.SandwichOperator.make(R_p, N.inverse),
D_inv_1
=
ift
.
InversionEnabler
(
D_inv_1
,
inverter
)
D_inv_2
=
ift
.
SamplingEnabler
2
(
D_inv
,
sampling_inverter
)
D_inv_2
=
ift
.
Greedy
SamplingEnabler
(
D_inv
,
sampling_inverter
)
# GOOD
samps_1
=
[
D_inv_1
.
draw_sample
(
from_inverse
=
True
)
for
i
in
range
(
N_samps
)]
...
...
nifty4/operators/__init__.py
View file @
ecdcd3a6
...
...
@@ -12,11 +12,11 @@ from .power_distributor import PowerDistributor
from
.inversion_enabler
import
InversionEnabler
from
.sandwich_operator
import
SandwichOperator
from
.sampling_enabler
import
SamplingEnabler
from
.sampling_enabler
2
import
SamplingEnabler
2
from
.sampling_enabler
_greedy
import
Greedy
SamplingEnabler
__all__
=
[
"LinearOperator"
,
"EndomorphicOperator"
,
"ScalingOperator"
,
"DiagonalOperator"
,
"HarmonicTransformOperator"
,
"FFTOperator"
,
"FFTSmoothingOperator"
,
"GeometryRemover"
,
"LaplaceOperator"
,
"SmoothnessOperator"
,
"PowerDistributor"
,
"InversionEnabler"
,
"SandwichOperator"
,
"SamplingEnabler"
,
"SamplingEnabler
2
"
]
"
Greedy
SamplingEnabler"
]
nifty4/operators/sampling_enabler.py
View file @
ecdcd3a6
...
...
@@ -16,11 +16,10 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
import
numpy
as
np
from
..minimization.quadratic_energy
import
QuadraticEnergy
from
..minimization.iteration_controller
import
IterationController
from
..logger
import
logger
from
.endomorphic_operator
import
EndomorphicOperator
import
numpy
as
np
class
SamplingEnabler
(
EndomorphicOperator
):
...
...
nifty4/operators/sampling_enabler
2
.py
→
nifty4/operators/sampling_enabler
_greedy
.py
View file @
ecdcd3a6
...
...
@@ -16,15 +16,13 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from
..minimization.quadratic_energy
import
QuadraticEnergy
from
..minimization.iteration_controller
import
IterationController
from
..logger
import
logger
import
numpy
as
np
from
.endomorphic_operator
import
EndomorphicOperator
from
.inversion_enabler
import
InversionEnabler
import
numpy
as
np
class
SamplingEnabler
2
(
EndomorphicOperator
):
class
Greedy
SamplingEnabler
(
EndomorphicOperator
):
"""Class which augments the capability of another operator object via
numerical inversion.
...
...
@@ -46,7 +44,7 @@ class SamplingEnabler2(EndomorphicOperator):
"""
def
__init__
(
self
,
op
,
sampling_inverter
,
approximation
=
None
):
super
(
SamplingEnabler
2
,
self
).
__init__
()
super
(
Greedy
SamplingEnabler
,
self
).
__init__
()
self
.
_op
=
op
self
.
_sampling_op
=
InversionEnabler
(
op
,
sampling_inverter
,
approximation
=
approximation
)
...
...
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