Commit bbfe02a1 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

Merge branch 'NIFTy_5' into fix_doc

parents 6447e7a8 ee760ed2
Pipeline #63499 passed with stages
in 8 minutes and 24 seconds
...@@ -95,7 +95,7 @@ def _actual_domain_check(op, domain_dtype=None, inp=None): ...@@ -95,7 +95,7 @@ def _actual_domain_check(op, domain_dtype=None, inp=None):
assert_(op(inp).domain is op.target) assert_(op(inp).domain is op.target)
def _actual_domain_check_nonlinear(op, loc, target_dtype=np.float64): def _actual_domain_check_nonlinear(op, loc):
assert isinstance(loc, (Field, MultiField)) assert isinstance(loc, (Field, MultiField))
assert_(loc.domain is op.domain) assert_(loc.domain is op.domain)
lin = Linearization.make_var(loc, False) lin = Linearization.make_var(loc, False)
...@@ -112,7 +112,7 @@ def _actual_domain_check_nonlinear(op, loc, target_dtype=np.float64): ...@@ -112,7 +112,7 @@ def _actual_domain_check_nonlinear(op, loc, target_dtype=np.float64):
assert_(reslin.jac.domain is reslin.domain) assert_(reslin.jac.domain is reslin.domain)
assert_(reslin.jac.target is reslin.target) assert_(reslin.jac.target is reslin.target)
_actual_domain_check(reslin.jac, inp=loc) _actual_domain_check(reslin.jac, inp=loc)
_actual_domain_check(reslin.jac.adjoint, domain_dtype=target_dtype) _actual_domain_check(reslin.jac.adjoint, inp=reslin.jac(loc))
def _domain_check(op): def _domain_check(op):
......
...@@ -63,7 +63,7 @@ class _LightConeDerivative(LinearOperator): ...@@ -63,7 +63,7 @@ class _LightConeDerivative(LinearOperator):
if mode == self.TIMES: if mode == self.TIMES:
res += self._derivatives[i]*x[i] res += self._derivatives[i]*x[i]
else: else:
res[i] = np.sum(self._derivatives[i]*x) res[i] = np.sum(self._derivatives[i]*x.real)
return Field.from_global_data(self._tgt(mode), res) return Field.from_global_data(self._tgt(mode), res)
......
...@@ -250,20 +250,18 @@ class InverseGammaLikelihood(EnergyOperator): ...@@ -250,20 +250,18 @@ class InverseGammaLikelihood(EnergyOperator):
class StudentTEnergy(EnergyOperator): class StudentTEnergy(EnergyOperator):
"""Computes likelihood energy of expected event frequency constrained by """Computes likelihood energy corresponding to Student's t-distribution.
event data.
.. math :: .. math ::
E(f) = -\\log \\text{Bernoulli}(d|f) E_\\theta(f) = -\\log \\text{StudentT}_\\theta(f)
= -d^\\dagger \\log f - (1-d)^\\dagger \\log(1-f), = \\frac{\\theta + 1}{2} \\log(1 + \\frac{f^2}{\\theta}),
where f is a field defined on `d.domain` with the expected where f is a field defined on `domain`.
frequencies of events.
Parameters Parameters
---------- ----------
d : Field domain : `Domain` or `DomainTuple`
Data field with events (1) or non-events (0). Domain of the operator
theta : Scalar theta : Scalar
Degree of freedom parameter for the student t distribution Degree of freedom parameter for the student t distribution
""" """
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment