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
2e60bc93
Commit
2e60bc93
authored
May 13, 2019
by
Lukas Platz
Browse files
enable without_mean by default for spherical domains
parent
f37c42e8
Pipeline
#48175
passed with stages
in 8 minutes and 40 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty5/operators/convolution_operators.py
View file @
2e60bc93
...
...
@@ -30,7 +30,7 @@ from ..field import Field
from
..
import
utilities
def
FuncConvolutionOperator
(
domain
,
func
,
space
=
None
,
without_mean
=
Fals
e
):
def
FuncConvolutionOperator
(
domain
,
func
,
space
=
None
,
without_mean
=
Non
e
):
"""Convolves input with a radially symmetric kernel defined by `func`
Parameters
...
...
@@ -46,6 +46,9 @@ def FuncConvolutionOperator(domain, func, space=None, without_mean=False):
If None, it is set to 0 if `domain` contains exactly one space.
`domain[space]` must be of type `RGSpace`, `HPSpace`, or `GLSpace`.
without_mean: bool, optional
If `None`, chooses domain-dependant default value:
- `True` for spherical domains (`HPSpace`, `GLSpace`)
- `False` for RGSpaces.
If `True`, subtracts the input mean before applying the convolution
and adds it back afterwards.
...
...
@@ -62,6 +65,11 @@ def FuncConvolutionOperator(domain, func, space=None, without_mean=False):
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
)
...
...
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