# sporco.fista.cbpdn¶

Classes for FISTA algorithm for the Convolutional BPDN problem

Classes

 ConvBPDN(D, S[, lmbda, opt, dimK, dimN]) Base class for FISTA algorithm for the Convolutional BPDN (CBPDN) [19] problem. ConvBPDNMask(D, S, lmbda[, W, opt, dimK, dimN]) FISTA algorithm for Convolutional BPDN with a spatial mask.

## Class Descriptions¶

class sporco.fista.cbpdn.ConvBPDN(D, S, lmbda=None, opt=None, dimK=None, dimN=2)[source]

Base class for FISTA algorithm for the Convolutional BPDN (CBPDN) [19] problem.

The generic problem form is

$\mathrm{argmin}_\mathbf{x} \; f( \{ \mathbf{x}_m \} ) + \lambda g( \{ \mathbf{x}_m \} )$

where $$f = (1/2) \left\| \sum_m \mathbf{d}_m * \mathbf{x}_m - \mathbf{s} \right\|_2^2$$, and $$g(\cdot)$$ is a penalty term or the indicator function of a constraint; with input image $$\mathbf{s}$$, dictionary filters $$\mathbf{d}_m$$, and coefficient maps $$\mathbf{x}_m$$. It is solved via the FISTA formulation

Proximal step

$\mathbf{x}_k = \mathrm{prox}_{t_k}(g) (\mathbf{y}_k - 1/L \nabla f(\mathbf{y}_k) ) \;\;.$

Combination step

$\mathbf{y}_{k+1} = \mathbf{x}_k + \left( \frac{t_k - 1}{t_{k+1}} \right) (\mathbf{x}_k - \mathbf{x}_{k-1}) \;\;,$

with $$t_{k+1} = \frac{1 + \sqrt{1 + 4 t_k^2}}{2}$$.

After termination of the solve method, attribute itstat is a list of tuples representing statistics of each iteration. The fields of the named tuple IterationStats are:

Iter : Iteration number

ObjFun : Objective function value

DFid : Value of data fidelity term $$(1/2) \| \sum_m \mathbf{d}_m * \mathbf{x}_m - \mathbf{s} \|_2^2$$

RegL1 : Value of regularisation term $$\sum_m \| \mathbf{x}_m \|_1$$

Rsdl : Residual

L : Inverse of gradient step parameter

Time : Cumulative run time

This class supports an arbitrary number of spatial dimensions, dimN, with a default of 2. The input dictionary D is either dimN + 1 dimensional, in which case each spatial component (image in the default case) is assumed to consist of a single channel, or dimN + 2 dimensional, in which case the final dimension is assumed to contain the channels (e.g. colour channels in the case of images). The input signal set S is either dimN dimensional (no channels, only one signal), dimN + 1 dimensional (either multiple channels or multiple signals), or dimN + 2 dimensional (multiple channels and multiple signals). Determination of problem dimensions is handled by cnvrep.CSC_ConvRepIndexing.

Call graph

Parameters: D : array_like Dictionary array S : array_like Signal array lmbda : float Regularisation parameter opt : Algorithm options dimK : 0, 1, or None, optional (default None) Number of dimensions in input signal corresponding to multiple independent signals dimN : int, optional (default 2) Number of spatial/temporal dimensions
class Options(opt=None)[source]

Bases: sporco.fista.fista.Options

ConvBPDN algorithm options

Options include all of those defined in fista.FISTADFT.Options, together with additional options:

NonNegCoef : Flag indicating whether to force solution to be non-negative.

NoBndryCross : Flag indicating whether all solution coefficients corresponding to filters crossing the image boundary should be forced to zero.

L1Weight : An array of weights for the $$\ell_1$$ norm. The array shape must be such that the array is compatible for multiplication with the X/Y variables. If this option is defined, the regularization term is $$\lambda \sum_m \| \mathbf{w}_m \odot \mathbf{x}_m \|_1$$ where $$\mathbf{w}_m$$ denotes slices of the weighting array on the filter index axis.

Parameters: opt : dict or None, optional (default None) ConvBPDN algorithm options
setdict(D=None)[source]

Set dictionary array.

getcoef()[source]

Get final coefficient array.

eval_grad()[source]

eval_Rf(Vf)[source]

Evaluate smooth term in Vf.

eval_proxop(V)[source]

Compute proximal operator of $$g$$.

rsdl()[source]

Compute fixed point residual in Fourier domain.

eval_objfn()[source]

Compute components of objective function as well as total contribution to objective function.

obfn_dfd()[source]

Compute data fidelity term $$(1/2) \| \sum_m \mathbf{d}_m * \mathbf{x}_m - \mathbf{s} \|_2^2$$. This function takes into account the unnormalised DFT scaling, i.e. given that the variables are the DFT of multi-dimensional arrays computed via rfftn, this returns the data fidelity term in the original (spatial) domain.

obfn_reg()[source]

Compute regularisation term and contribution to objective function.

obfn_f(Xf=None)[source]

Compute data fidelity term $$(1/2) \| \sum_m \mathbf{d}_m * \mathbf{x}_m - \mathbf{s} \|_2^2$$ This is used for backtracking. Since the backtracking is computed in the DFT, it is important to preserve the DFT scaling.

reconstruct(X=None)[source]

Reconstruct representation.

solve()

Call graph

class sporco.fista.cbpdn.ConvBPDNMask(D, S, lmbda, W=None, opt=None, dimK=None, dimN=2)[source]

FISTA algorithm for Convolutional BPDN with a spatial mask.

Solve the optimisation problem

$\mathrm{argmin}_\mathbf{x} \; (1/2) \left\| W \left(\sum_m \mathbf{d}_m * \mathbf{x}_m - \mathbf{s}\right) \right\|_2^2 + \lambda \sum_m \| \mathbf{x}_m \|_1 \;\;,$

where $$W$$ is a mask array.

See ConvBPDN for interface details.

Parameters: D : array_like Dictionary matrix S : array_like Signal vector or matrix lmbda : float Regularisation parameter W : array_like Mask array. The array shape must be such that the array is compatible for multiplication with input array S (see cnvrep.mskWshape for more details). opt : ConvBPDNMask.Options object Algorithm options dimK : 0, 1, or None, optional (default None) Number of dimensions in input signal corresponding to multiple independent signals dimN : int, optional (default 2) Number of spatial dimensions
eval_grad()[source]

obfn_dfd()[source]
Compute data fidelity term $$(1/2) \| W (\sum_m \mathbf{d}_m * \mathbf{x}_{m} - \mathbf{s}) \|_2^2$$
obfn_f(Xf=None)[source]
Compute data fidelity term $$(1/2) \| W (\sum_m \mathbf{d}_m * \mathbf{x}_{m} - \mathbf{s}) \|_2^2$$. This is used for backtracking. Since the backtracking is computed in the DFT, it is important to preserve the DFT scaling.