# sporco.fista.ccmod¶

FISTA algorithms for the CCMOD problem

Classes

 ConvCnstrMOD(Z, S, dsz[, opt, dimK, dimN]) Base class for FISTA algorithm for Convolutional Constrained MOD problem [19]. ConvCnstrMODMask(Z, S, W, dsz[, opt, dimK, dimN]) FISTA algorithm for Convolutional Constrained MOD problem with a spatial mask [19].

## Class Descriptions¶

class sporco.fista.ccmod.ConvCnstrMOD(Z, S, dsz, opt=None, dimK=1, dimN=2)[source]

Base class for FISTA algorithm for Convolutional Constrained MOD problem [19].

Solve the optimisation problem

$\mathrm{argmin}_\mathbf{d} \; (1/2) \sum_k \left\| \sum_m \mathbf{d}_m * \mathbf{x}_{k,m} - \mathbf{s}_k \right\|_2^2 \quad \text{such that} \quad \mathbf{d}_m \in C$

via the FISTA problem

$\mathrm{argmin}_\mathbf{d} \; (1/2) \sum_k \left\| \sum_m \mathbf{d}_m * \mathbf{x}_{k,m} - \mathbf{s}_k \right\|_2^2 + \sum_m \iota_C(\mathbf{d}_m) \;\;,$

where $$\iota_C(\cdot)$$ is the indicator function of feasible set $$C$$ consisting of filters with unit norm and constrained support. Multi-channel problems with input image channels $$\mathbf{s}_{c,k}$$ are also supported, either as

$\mathrm{argmin}_\mathbf{d} \; (1/2) \sum_c \sum_k \left\| \sum_m \mathbf{d}_m * \mathbf{x}_{c,k,m} - \mathbf{s}_{c,k} \right\|_2^2 \quad \text{such that} \quad \mathbf{d}_m \in C$

with single-channel dictionary filters $$\mathbf{d}_m$$ and multi-channel coefficient maps $$\mathbf{x}_{c,k,m}$$, or

$\mathrm{argmin}_\mathbf{d} \; (1/2) \sum_c \sum_k \left\| \sum_m \mathbf{d}_{c,m} * \mathbf{x}_{k,m} - \mathbf{s}_{c,k} \right\|_2^2 \quad \text{such that} \quad \mathbf{d}_{c,m} \in C$

with multi-channel dictionary filters $$\mathbf{d}_{c,m}$$ and single-channel coefficient maps $$\mathbf{x}_{k,m}$$. In this latter case, normalisation of filters $$\mathbf{d}_{c,m}$$ is performed jointly over index $$c$$ for each filter $$m$$.

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

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

Cnstr : Constraint violation measure

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 coefficient map array Z (usually labelled X, but renamed here to avoid confusion with the X and Y variables in the FISTA base class) is expected to be in standard form as computed by the GenericConvBPDN class.

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). Parameter dimK, with a default value of 1, indicates the number of multiple-signal dimensions in S:

Default dimK = 1, i.e. assume input S is of form
S(N0,  N1,   C,   K)  or  S(N0,  N1,   K)
If dimK = 0 then input S is of form
S(N0,  N1,   C,   K)  or  S(N0,  N1,   C)


The internal data layout for S, D (X here), and X (Z here) is:

dim<0> - dim<Nds-1> : Spatial dimensions, product of N0,N1,... is N
dim<Nds>            : C number of channels in S and D
dim<Nds+1>          : K number of signals in S
dim<Nds+2>          : M number of filters in D

sptl.      chn  sig  flt
S(N0,  N1,   C,   K,   1)
D(N0,  N1,   C,   1,   M)   (X here)
X(N0,  N1,   1,   K,   M)   (Z here)


The dsz parameter indicates the desired filter supports in the output dictionary, since this cannot be inferred from the input variables. The format is the same as the dsz parameter of cnvrep.bcrop.

Call graph

Parameters: Z : array_like Coefficient map array S : array_like Signal array dsz : tuple Filter support size(s) opt : ccmod.Options object Algorithm options dimK : int, optional (default 1) Number of dimensions for multiple signals in input S dimN : int, optional (default 2) Number of spatial dimensions
class Options(opt=None)[source]

Bases: sporco.fista.fista.Options

ConvCnstrMOD algorithm options

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

ZeroMean : Flag indicating whether the solution dictionary $$\{\mathbf{d}_m\}$$ should have zero-mean components.
Parameters: opt : dict or None, optional (default None) ConvCnstrMOD algorithm options
setcoef(Z)[source]

Set coefficient array.

getdict(crop=True)[source]

Get final dictionary. If crop is True, apply cnvrep.bcrop to returned 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$$.

obfn_cns()[source]

Compute constraint violation measure $$\| P(\mathbf{y}) - \mathbf{y}\|_2$$.

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(D=None)[source]

Reconstruct representation.

solve()

Call graph

class sporco.fista.ccmod.ConvCnstrMODMask(Z, S, W, dsz, opt=None, dimK=None, dimN=2)[source]

FISTA algorithm for Convolutional Constrained MOD problem with a spatial mask [19].

Solve the optimisation problem

$\mathrm{argmin}_\mathbf{d} \; (1/2) \left\| W \left(\sum_m \mathbf{d}_m * \mathbf{x}_m - \mathbf{s}\right) \right\|_2^2 \quad \text{such that} \quad \mathbf{d}_m \in C \;\; \forall m$

where $$C$$ is the feasible set consisting of filters with unit norm and constrained support, and $$W$$ is a mask array, via the FISTA problem

$\mathrm{argmin}_{\mathbf{d}} \; (1/2) \left\| W \left(X \mathbf{d} - \mathbf{s}\right) \right\|_2^2 + \iota_C(\mathbf{d}_m) \;\;,$

where $$\iota_C(\cdot)$$ is the indicator function of feasible set $$C$$, and $$X \mathbf{d} = \sum_m \mathbf{x}_m * \mathbf{d}_m$$.

See ConvCnstrMOD for interface details.

Call graph

Parameters: Z : array_like Coefficient map array S : array_like Signal array W : array_like Mask array. The array shape must be such that the array is compatible for multiplication with the internal shape of input array S (see cnvrep.CDU_ConvRepIndexing for a discussion of the distinction between external and internal data layouts). dsz : tuple Filter support size(s) opt : ConvCnstrMODMasked.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
class Options(opt=None)[source]

Bases: sporco.fista.ccmod.Options

Options include all of those defined in fista.FISTA.Options.

Parameters: opt : dict or None, optional (default None) ConvCnstrMODMasked algorithm options
eval_grad()[source]

solve()

Call graph

obfn_dfd()[source]

Compute data fidelity term $$(1/2) \sum_k \| W (\sum_m \mathbf{d}_m * \mathbf{x}_{k,m} - \mathbf{s}_k) \|_2^2$$

obfn_f(Xf=None)[source]

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