pnp_mace.forwardagent

Forward agents.

Classes

ForwardAgent(data_to_fit, ...)

Class to provide a container and interface to various forward models.

LinearProxForwardAgent(data_to_fit, A, AT, sigma)

Class providing a container and interface to a proximal map forward model for a cost function of the form

class pnp_mace.forwardagent.ForwardAgent(data_to_fit, forward_agent_method, params)[source]

Bases: pnp_mace.agent.Agent

Class to provide a container and interface to various forward models.

Define the basic elements of the forward agent: the data to fit and the method used to update the input to reflect the data.

Parameters
  • data_to_fit – data in form used by forward_agent_method

  • forward_agent_method – method to update input to reflect data

  • params – parameters used by the forward agent method

class pnp_mace.forwardagent.LinearProxForwardAgent(data_to_fit, A, AT, sigma)[source]

Bases: pnp_mace.forwardagent.ForwardAgent

Class providing a container and interface to a proximal map forward model for a cost function of the form

\[f(x) = (1/2) \| y - Av \|_2^2\]

The associated proximal map has the form

\[F(x) = \mathrm{argmin}_v \; (1/2) \| y - Av \|^2 + (1 / (2\sigma^2)) \| x - v \|^2\]

The solution is

\[F(x) = x + \sigma^2 (I + \sigma^2 A^T A)^{-1} A^T (y - Ax)\]

This form is typically not practical unless A A^T is a multiple of the identity matrix, which is true for some important special cases, but not in general.

Instead of solving the optimization problem as in the ProxAgent, \(F(x) = v^*\) can be written as an implicit step using

\[v^* = x + \alpha \sigma^2 A^T (y - Av^*)\]

As in [2], we implement this version using the previous output of \(v^* = F(x)\), which is saved in an instance variable.

Define the basic elements of the forward agent: the data to fit and the data-fitting cost function (determined by the forward and back projectors A and AT).

As shown in a paper by Emma Reid, et al., replacing AT by a linear operator B that approximates AT is equivalent to changing the prior agent. In some contexts, this is known as mismatched back-projection.

One example is to use one form of downsampling for A and a type of upsampling for B that approximates AT but is not exactly AT. Another example is to use forward projection from the Radon transform as A and filtered back-projection as B. In some cases, this improves the final reconstruction.

Parameters
  • data_to_fit – data in a form consistent with the output of A

  • A – linear operator - forward projector

  • AT – linear operator - back projector (see notes above on mismatched back-projection)

  • sigma – estimate of desired step size - small sigma leads to small steps

linear_prox_implicit_step(x, data, A, AT, sigmasq)[source]

Instead of solving the proximal map optimization problem as in the ProxAgent, \(F(x) = v^*\) can be written as an implicit step using

\[v^{k+1} = x + \sigma^2 A^T (y - Av^k)\]

where y = data. We implement this version using the previous output of \(v^* = F(x)\), which is saved in an instance variable.

Parameters
  • x – Candidate reconstruction

  • data – Data to fit

  • A – linear operator - forward projector. Assumed to be either an operator or a numpy array that multiplies x.

  • AT – linear operator - back projector (see notes above on mismatched back-projection). Assumed to be either an operator or a numpy array that multiplies Ax.

  • sigmasq – estimate of desired step size - small sigma leads to small steps

Returns

An approximation of \(F(x) = v^*\) as defined above.