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
e7b57ee4
Commit
e7b57ee4
authored
Feb 19, 2019
by
Martin Reinecke
Browse files
make operator private
parent
360cac16
Changes
2
Hide whitespace changes
Inline
Side-by-side
nifty5/__init__.py
View file @
e7b57ee4
...
@@ -50,8 +50,7 @@ from .operators.value_inserter import ValueInserter
...
@@ -50,8 +50,7 @@ from .operators.value_inserter import ValueInserter
from
.operators.energy_operators
import
(
from
.operators.energy_operators
import
(
EnergyOperator
,
GaussianEnergy
,
PoissonianEnergy
,
InverseGammaLikelihood
,
EnergyOperator
,
GaussianEnergy
,
PoissonianEnergy
,
InverseGammaLikelihood
,
BernoulliEnergy
,
StandardHamiltonian
,
AveragedEnergy
)
BernoulliEnergy
,
StandardHamiltonian
,
AveragedEnergy
)
from
.operators.convolution_operators
import
(
from
.operators.convolution_operators
import
SphericalFuncConvolutionOperator
SphericalConvolutionOperator
,
SphericalFuncConvolutionOperator
)
from
.probing
import
probe_with_posterior_samples
,
probe_diagonal
,
\
from
.probing
import
probe_with_posterior_samples
,
probe_diagonal
,
\
StatCalculator
StatCalculator
...
...
nifty5/operators/convolution_operators.py
View file @
e7b57ee4
...
@@ -44,14 +44,13 @@ def SphericalFuncConvolutionOperator(domain, func):
...
@@ -44,14 +44,13 @@ def SphericalFuncConvolutionOperator(domain, func):
if
not
isinstance
(
domain
[
0
],
(
HPSpace
,
GLSpace
)):
if
not
isinstance
(
domain
[
0
],
(
HPSpace
,
GLSpace
)):
raise
TypeError
(
"need a spherical domain"
)
raise
TypeError
(
"need a spherical domain"
)
kernel
=
domain
[
0
].
get_default_codomain
().
get_conv_kernel_from_func
(
func
)
kernel
=
domain
[
0
].
get_default_codomain
().
get_conv_kernel_from_func
(
func
)
return
SphericalConvolutionOperator
(
domain
,
kernel
)
return
_
SphericalConvolutionOperator
(
domain
,
kernel
)
class
SphericalConvolutionOperator
(
EndomorphicOperator
):
class
_
SphericalConvolutionOperator
(
EndomorphicOperator
):
"""Convolves with kernel living on the appropriate LMSpace"""
"""Convolves with kernel living on the appropriate LMSpace"""
def
__init__
(
self
,
domain
,
kernel
):
def
__init__
(
self
,
domain
,
kernel
):
if
len
(
domain
)
!=
1
:
if
len
(
domain
)
!=
1
:
raise
ValueError
(
"need exactly one domain"
)
raise
ValueError
(
"need exactly one domain"
)
if
len
(
kernel
.
domain
)
!=
1
:
if
len
(
kernel
.
domain
)
!=
1
:
...
...
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