pnp_mace.equilibriumproblem

EquilibriumProblem class and solution methods.

Functions

F(agents, images_in)

The stacked agent map.

G(mu, images_in, images_out)

The stacked averaging map.

mann_iteration_mace(init_images, agents, params)

Apply Mann iterations.

Classes

EquilibriumProblem(agents, solution_method, ...)

Class providing a container and interface to various equilibrium formulations and solution algorithms.

class pnp_mace.equilibriumproblem.EquilibriumProblem(agents, solution_method, params)[source]

Bases: object

Class providing a container and interface to various equilibrium formulations and solution algorithms.

Define the basic elements of the equilibrium problem.

Parameters
  • agents – list of forward and prior agents

  • solution_method – callable method to find a solution

  • params – parameters used by the solution method

solve(init_image)[source]

Interface to algorithm to solve the problem.

Parameters

init_image – Initial image for iterative reconstruction

Returns

DotMap with solution and any information about convergence and residual

pnp_mace.equilibriumproblem.mann_iteration_mace(init_images, agents, params)[source]

Apply Mann iterations.

Apply Mann iterations of the form \(x(k+1) = (1 - \rho) x(k) + \rho (2G - I)(2F - I)(x)\) [1]

Parameters
  • init_images – A list of images to be used as a stacked vector input to the agents

  • agents – A list of agents, both forward and prior

  • paramsparams.mu gives weighting of agents (should be positive adding to 1), params.rho gives Mann parameter, params.num_iters gives number of iterations, params.added_noise_std gives the noise level added to each iteration for generative MACE

Returns

A list of output images after num_iters

pnp_mace.equilibriumproblem.F(agents, images_in)[source]

The stacked agent map.

Takes a list of agents and a list of images and applies each agent to the corresponding image.

Parameters
  • agents – List of agents

  • images_in – List of input images

Returns

List of output images after applying the agents

pnp_mace.equilibriumproblem.G(mu, images_in, images_out)[source]

The stacked averaging map.

Takes a list of images, applies a weighted average, and redistributes them in a list.

Parameters
  • mu – Weights for the average

  • images_in – List of input images

  • images_out – List of output images (used to provide memory for the output)

Returns

Averaged input images, copied into the list images_out