Commit 7999e816 authored by Julia Stadler's avatar Julia Stadler
Browse files

possonian engery

parent 9f8bd423
......@@ -192,8 +192,12 @@ class PoissonianEnergy(EnergyOperator):
res = x.sum() - x.log().vdot(self._d)
if not isinstance(x, Linearization):
if res.val != res.val:
return Field.scalar(np.inf)
return Field.scalar(res)
if not x.want_metric:
if res.val.val != res.val.val:
res =, res.jac)
return res
metric = SandwichOperator.make(x.jac, makeOp(1./x.val))
return res.add_metric(metric)
Supports Markdown
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