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
Open sidebar
ift
NIFTy
Commits
3b36c8a3
Commit
3b36c8a3
authored
Jul 18, 2019
by
Lukas Platz
Browse files
unconditionally convolve without signal mean
parent
1439a2b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty5/operators/convolution_operators.py
View file @
3b36c8a3
...
...
@@ -30,7 +30,7 @@ from ..field import Field
from
..
import
utilities
def
FuncConvolutionOperator
(
domain
,
func
,
space
=
None
,
without_mean
=
None
):
def
FuncConvolutionOperator
(
domain
,
func
,
space
=
None
):
"""Convolves input with a radially symmetric kernel defined by `func`
Parameters
...
...
@@ -65,15 +65,10 @@ def FuncConvolutionOperator(domain, func, space=None, without_mean=None):
raise
TypeError
(
"unsupported domain"
)
codomain
=
domain
[
space
].
get_default_codomain
()
kernel
=
codomain
.
get_conv_kernel_from_func
(
func
)
if
without_mean
==
None
:
if
isinstance
(
domain
[
space
],
(
HPSpace
,
GLSpace
)):
without_mean
=
True
else
:
without_mean
=
False
return
_ConvolutionOperator
(
domain
,
kernel
,
space
,
without_mean
)
return
_ConvolutionOperator
(
domain
,
kernel
,
space
)
def
_ConvolutionOperator
(
domain
,
kernel
,
space
=
None
,
without_mean
=
False
):
def
_ConvolutionOperator
(
domain
,
kernel
,
space
=
None
):
domain
=
DomainTuple
.
make
(
domain
)
space
=
utilities
.
infer_space
(
domain
,
space
)
if
len
(
kernel
.
domain
)
!=
1
:
...
...
@@ -89,10 +84,7 @@ def _ConvolutionOperator(domain, kernel, space=None, without_mean=False):
diag
=
DiagonalOperator
(
kernel
*
domain
[
space
].
total_volume
,
lm
,
(
space
,))
wgt
=
WeightApplier
(
domain
,
space
,
1
)
op
=
HT
(
diag
(
HT
.
adjoint
(
wgt
)))
if
without_mean
:
return
_ApplicationWithoutMeanOperator
(
op
)
else
:
return
op
return
_ApplicationWithoutMeanOperator
(
op
)
class
_ApplicationWithoutMeanOperator
(
EndomorphicOperator
):
...
...
Write
Preview
Supports
Markdown
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