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
8
Merge Requests
8
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
74b271ba
Commit
74b271ba
authored
Jan 24, 2019
by
Martin Reinecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cosmetics
parent
39a0aa47
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
19 additions
and
16 deletions
+19
-16
nifty5/library/adjust_variances.py
nifty5/library/adjust_variances.py
+4
-2
nifty5/library/smooth_linear_amplitude.py
nifty5/library/smooth_linear_amplitude.py
+2
-1
nifty5/operators/contraction_operator.py
nifty5/operators/contraction_operator.py
+2
-1
nifty5/operators/endomorphic_operator.py
nifty5/operators/endomorphic_operator.py
+2
-2
nifty5/operators/linear_interpolation.py
nifty5/operators/linear_interpolation.py
+2
-3
nifty5/operators/sampling_enabler.py
nifty5/operators/sampling_enabler.py
+4
-4
nifty5/operators/simple_linear_operators.py
nifty5/operators/simple_linear_operators.py
+1
-1
nifty5/plot.py
nifty5/plot.py
+2
-2
No files found.
nifty5/library/adjust_variances.py
View file @
74b271ba
...
...
@@ -18,7 +18,8 @@
from
..minimization.energy_adapter
import
EnergyAdapter
from
..multi_field
import
MultiField
from
..operators.distributors
import
PowerDistributor
from
..operators.energy_operators
import
StandardHamiltonian
,
InverseGammaLikelihood
from
..operators.energy_operators
import
(
StandardHamiltonian
,
InverseGammaLikelihood
)
from
..operators.scaling_operator
import
ScalingOperator
from
..operators.simple_linear_operators
import
ducktape
...
...
@@ -72,7 +73,8 @@ def make_adjust_variances(a,
if
scaling
is
not
None
:
x
=
ScalingOperator
(
scaling
,
x
.
target
)(
x
)
return
StandardHamiltonian
(
InverseGammaLikelihood
(
d_eval
/
2.
)(
x
),
ic_samp
=
ic_samp
)
return
StandardHamiltonian
(
InverseGammaLikelihood
(
d_eval
/
2.
)(
x
),
ic_samp
=
ic_samp
)
def
do_adjust_variances
(
position
,
...
...
nifty5/library/smooth_linear_amplitude.py
View file @
74b271ba
...
...
@@ -138,7 +138,8 @@ def SLAmplitude(*, target, n_pix, a, k0, sm, sv, im, iv, keys=['tau', 'phi']):
of the linear function.
The prior on the smooth component is parametrized by two real numbers: the
strength and the cutoff of the smoothness prior (see :class:`CepstrumOperator`).
strength and the cutoff of the smoothness prior
(see :class:`CepstrumOperator`).
Parameters
----------
...
...
nifty5/operators/contraction_operator.py
View file @
74b271ba
...
...
@@ -24,7 +24,8 @@ from .linear_operator import LinearOperator
class
ContractionOperator
(
LinearOperator
):
"""A :class:`LinearOperator` which sums up fields into the direction of subspaces.
"""A :class:`LinearOperator` which sums up fields into the direction of
subspaces.
This Operator sums up a field with is defined on a :class:`DomainTuple`
to a :class:`DomainTuple` which contains the former as a subset.
...
...
nifty5/operators/endomorphic_operator.py
View file @
74b271ba
...
...
@@ -21,8 +21,8 @@ from .linear_operator import LinearOperator
class
EndomorphicOperator
(
LinearOperator
):
"""Represents a :class:`LinearOperator` which is endomorphic, i.e. one
which
has identical domain and target.
"""Represents a :class:`LinearOperator` which is endomorphic, i.e. one
which
has identical domain and target.
"""
@
property
def
target
(
self
):
...
...
nifty5/operators/linear_interpolation.py
View file @
74b271ba
...
...
@@ -53,9 +53,8 @@ class LinearInterpolator(LinearOperator):
# FIXME This needs to be removed as soon as the bug below is fixed.
if
dims
.
count
(
dims
[
0
])
!=
len
(
dims
):
raise
TypeError
(
'This is a bug. Please extend LinearInterpolators functionality!'
)
raise
TypeError
(
"This is a bug. Please extend"
"LinearInterpolator's functionality!"
)
shp
=
sampling_points
.
shape
if
not
(
isinstance
(
sampling_points
,
np
.
ndarray
)
and
len
(
shp
)
==
2
):
...
...
nifty5/operators/sampling_enabler.py
View file @
74b271ba
...
...
@@ -38,10 +38,10 @@ class SamplingEnabler(EndomorphicOperator):
The iteration controller to use for the iterative numerical inversion
done by a :class:`ConjugateGradient` object.
approximation : :class:`LinearOperator`, optional
if not None, this linear operator should be an approximation to the
operator, which
supports the operation modes that the operator doesn't have. It is used as a
preconditioner during the iterative inversion, to accelerate
convergence.
if not None, this linear operator should be an approximation to the
operator, which supports the operation modes that the operator doesn't
have. It is used as a preconditioner during the iterative inversion,
to accelerate
convergence.
"""
def
__init__
(
self
,
likelihood
,
prior
,
iteration_controller
,
...
...
nifty5/operators/simple_linear_operators.py
View file @
74b271ba
...
...
@@ -187,7 +187,7 @@ class GeometryRemover(LinearOperator):
domain: Domain, tuple of Domain, or DomainTuple:
the full input domain of the operator.
space: int, optional
The index of the subdomain on which the operator should act.
Default is None.
The index of the subdomain on which the operator should act.
If None, it acts on all spaces.
Notes
...
...
nifty5/plot.py
View file @
74b271ba
...
...
@@ -290,8 +290,8 @@ def _plot(f, ax, **kwargs):
if
not
isinstance
(
f
[
0
],
Field
):
raise
TypeError
(
"incorrect data type"
)
dom1
=
f
[
0
].
domain
if
(
len
(
dom1
)
==
1
and
(
isinstance
(
dom1
[
0
],
PowerSpace
)
or
if
(
len
(
dom1
)
==
1
and
(
isinstance
(
dom1
[
0
],
PowerSpace
)
or
(
isinstance
(
dom1
[
0
],
(
RGSpace
,
LogRGSpace
))
and
len
(
dom1
[
0
].
shape
)
==
1
))):
_plot1D
(
f
,
ax
,
**
kwargs
)
...
...
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