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

add PoissonEnergy

parent 735b0dd7
...@@ -3,4 +3,5 @@ from .wiener_filter_curvature import WienerFilterCurvature ...@@ -3,4 +3,5 @@ from .wiener_filter_curvature import WienerFilterCurvature
from .noise_energy import NoiseEnergy from .noise_energy import NoiseEnergy
from .nonlinear_power_energy import NonlinearPowerEnergy from .nonlinear_power_energy import NonlinearPowerEnergy
from .nonlinear_wiener_filter_energy import NonlinearWienerFilterEnergy from .nonlinear_wiener_filter_energy import NonlinearWienerFilterEnergy
from .poisson_energy import PoissonEnergy
from .nonlinearities import Exponential, Linear, Tanh, PositiveTanh from .nonlinearities import Exponential, Linear, Tanh, PositiveTanh
...@@ -24,11 +24,11 @@ from ..utilities import memo ...@@ -24,11 +24,11 @@ from ..utilities import memo
def _LinearizedPowerResponse(Instrument, nonlinearity, ht, Distributor, tau, def _LinearizedPowerResponse(Instrument, nonlinearity, ht, Distributor, tau,
xi): xi):
power = exp(0.5*tau) power = exp(0.5*tau)
position = ht(Distributor(power)*xi) position = ht(Distributor(power)*xi)
linearization = nonlinearity.derivative(position) linearization = nonlinearity.derivative(position)
return 0.5*Instrument*linearization*ht*xi*Distributor*power return 0.5*Instrument*linearization*ht*xi*Distributor*power
class NonlinearPowerEnergy(Energy): class NonlinearPowerEnergy(Energy):
......
...@@ -20,7 +20,7 @@ from ..minimization.quadratic_energy import QuadraticEnergy ...@@ -20,7 +20,7 @@ from ..minimization.quadratic_energy import QuadraticEnergy
from .wiener_filter_curvature import WienerFilterCurvature from .wiener_filter_curvature import WienerFilterCurvature
def WienerFilterEnergy(position, d, R, N, S, inverter): def WienerFilterEnergy(position, d, R, N, S, inverter=None):
"""The Energy for the Wiener filter. """The Energy for the Wiener filter.
It covers the case of linear measurement with It covers the case of linear measurement with
...@@ -39,8 +39,9 @@ def WienerFilterEnergy(position, d, R, N, S, inverter): ...@@ -39,8 +39,9 @@ def WienerFilterEnergy(position, d, R, N, S, inverter):
The noise covariance in data space. The noise covariance in data space.
S : EndomorphicOperator S : EndomorphicOperator
The prior signal covariance in harmonic space. The prior signal covariance in harmonic space.
inverter : Minimizer inverter : Minimizer, optional
the minimization strategy to use for operator inversion the minimization strategy to use for operator inversion
If None, the energy object will not support curvature computation.
""" """
op = WienerFilterCurvature(R, N, S, inverter) op = WienerFilterCurvature(R, N, S, inverter)
vec = R.adjoint_times(N.inverse_times(d)) vec = R.adjoint_times(N.inverse_times(d))
......
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