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
9ef50969
Commit
9ef50969
authored
Aug 14, 2018
by
Martin Reinecke
Browse files
cosmetics
parent
37e77ddb
Changes
2
Hide whitespace changes
Inline
Side-by-side
demos/getting_started_3.py
View file @
9ef50969
...
...
@@ -100,7 +100,7 @@ if __name__ == '__main__':
for
_
in
range
(
N_samples
)]
KL
=
ift
.
SampledKullbachLeiblerDivergence
(
H
,
samples
)
KL
=
ift
.
EnergyAdapter
(
position
,
KL
,
ic_cg
)
KL
=
ift
.
EnergyAdapter
(
position
,
KL
,
ic_cg
,
constants
=
[
"xi"
]
)
KL
,
convergence
=
minimizer
(
KL
)
position
=
KL
.
position
...
...
nifty5/operators/central_zero_padder.py
View file @
9ef50969
...
...
@@ -39,7 +39,8 @@ class CentralZeroPadder(LinearOperator):
---------
domain: Domain, tuple of Domains or DomainTuple
The domain of the data that is input by "times" and output by "adjoint_times"
The domain of the data that is input by "times" and output by
"adjoint_times"
new_shape: tuple
Shape of the target domain.
space: int, optional
...
...
@@ -48,7 +49,7 @@ class CentralZeroPadder(LinearOperator):
`domain[space]` must be an RGSpace.
"""
def
__init__
(
self
,
domain
,
new_shape
,
space
=
0
):
self
.
_domain
=
DomainTuple
.
make
(
domain
)
self
.
_space
=
utilities
.
infer_space
(
self
.
_domain
,
space
)
...
...
@@ -69,10 +70,10 @@ class CentralZeroPadder(LinearOperator):
self
.
_target
=
list
(
self
.
_domain
)
self
.
_target
[
self
.
_space
]
=
tgt
self
.
_target
=
DomainTuple
.
make
(
self
.
_target
)
self
.
_capability
=
self
.
TIMES
|
self
.
ADJOINT_TIMES
# define the axes along which the input fi
l
ed is sliced
# define the axes along which the input fie
l
d is sliced
slicer
=
[]
axes
=
self
.
_target
.
axes
[
self
.
_space
]
for
i
in
range
(
len
(
self
.
_domain
.
shape
)):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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