sporco.admm.pdcsc

Classes for ADMM algorithms for sparse coding with a product of convolutional and standard dictionaries

Classes

ConvProdDictBPDN(*args, **kwargs)

ADMM algorithm for the Convolutional BPDN (CBPDN) for multi-channel signals with a dictionary consisting of a product of convolutional and standard dictionaries [25].

ConvProdDictBPDNJoint(*args, **kwargs)

ADMM algorithm for the Convolutional BPDN (CBPDN) for multi-channel signals with a dictionary consisting of a product of convolutional and standard dictionaries, and with joint sparsity via an \(\ell_{2,1}\) norm term [25].

ConvProdDictL1L1Grd(*args, **kwargs)

ADMM algorithm for a Convolutional Sparse Coding problem for multi-channel signals with a dictionary consisting of a product of convolutional and standard dictionaries and with an \(\ell_1\) data fidelity term and both \(\ell_1\) and \(\ell_2\) of gradient regularisation terms [25].

ConvProdDictL1L1GrdJoint(*args, **kwargs)

ADMM algorithm for a Convolutional Sparse Coding problem for multi-channel signals with a dictionary consisting of a product of convolutional and standard dictionaries and with an \(\ell_1\) data fidelity term and \(\ell_{2,1}\), and \(\ell_2\) of gradient regularisation terms [25].


Class Descriptions

class sporco.admm.pdcsc.ConvProdDictBPDN(*args, **kwargs)[source]

Bases: ConvBPDN

ADMM algorithm for the Convolutional BPDN (CBPDN) for multi-channel signals with a dictionary consisting of a product of convolutional and standard dictionaries [25].

Solve the optimisation problem

\[\mathrm{argmin}_X \; (1/2) \left\| D X B^T - S \right\|_2^2 + \lambda \| X \|_1\]

where \(D\) is a convolutional dictionary, \(B\) is a standard dictionary, and \(S\) is a multi-channel input image with

\[S = \left( \begin{array}{ccc} \mathbf{s}_0 & \mathbf{s}_1 & \ldots \end{array} \right) \;.\]

where the signal channels form the columns, \(\mathbf{s}_c\), of \(S\). This problem is solved via the ADMM problem [25]

\[\mathrm{argmin}_{X,Y} \; (1/2) \left\| D X B^T - S \right\|_2^2 + \lambda \| Y \|_1 \quad \text{such that} \quad X = Y \;\;.\]
Parameters:
Darray_like

Convolutional dictionary array

Barray_like

Standard dictionary array

Sarray_like

Signal array

lmbdafloat

Regularisation parameter

optConvProdDictBPDN.Options object

Algorithm options

dimK0, 1, or None, optional (default None)

Number of dimensions in input signal corresponding to multiple independent signals

dimNint, optional (default 2)

Number of spatial/temporal dimensions

setdict(D=None, B=None)[source]

Set dictionary array.

xstep()[source]

Minimise Augmented Lagrangian with respect to \(\mathbf{x}\).

obfn_dfd()[source]

Compute data fidelity term \((1/2) \| D X B - S \|_2^2\).

rhochange()[source]

Updated cached c array when rho changes.

reconstruct(X=None)[source]

Reconstruct representation.

class sporco.admm.pdcsc.ConvProdDictBPDNJoint(*args, **kwargs)[source]

Bases: ConvProdDictBPDN

ADMM algorithm for the Convolutional BPDN (CBPDN) for multi-channel signals with a dictionary consisting of a product of convolutional and standard dictionaries, and with joint sparsity via an \(\ell_{2,1}\) norm term [25].

Solve the optimisation problem

\[\mathrm{argmin}_X \; (1/2) \left\| D X B^T - S \right\|_2^2 + \lambda \| X \|_1 + \mu \| X \|_{2,1}\]

where \(D\) is a convolutional dictionary, \(B\) is a standard dictionary, and \(S\) is a multi-channel input image with

\[S = \left( \begin{array}{ccc} \mathbf{s}_0 & \mathbf{s}_1 & \ldots \end{array} \right) \;.\]

where the signal channels form the columns, \(\mathbf{s}_c\), of \(S\). This problem is solved via the ADMM problem [25]

\[\mathrm{argmin}_{X,Y} \; (1/2) \left\| D X B^T - S \right\|_2^2 + \lambda \| Y \|_1 + \mu \| Y \|_{2,1} \quad \text{such that} \quad X = Y \;\;.\]
Parameters:
Darray_like

Convolutional dictionary array

Barray_like

Standard dictionary array

Sarray_like

Signal array

lmbdafloat

Regularisation parameter (l1)

mufloat

Regularisation parameter (l2,1)

optConvProdDictBPDNJoint.Options object

Algorithm options

dimK0, 1, or None, optional (default None)

Number of dimensions in input signal corresponding to multiple independent signals

dimNint, optional (default 2)

Number of spatial/temporal dimensions

itstat_fields_objfn = ('ObjFun', 'DFid', 'RegL1', 'RegL21')

Fields in IterationStats associated with the objective function; see eval_objfn

hdrtxt_objfn = ('Fnc', 'DFid', 'Regℓ1', 'Regℓ2,1')

Display column headers associated with the objective function; see eval_objfn

hdrval_objfun = {'DFid': 'DFid', 'Fnc': 'ObjFun', 'Regℓ1': 'RegL1', 'Regℓ2,1': 'RegL21'}

Dictionary mapping display column headers in hdrtxt_objfn to IterationStats entries

ystep()[source]

Minimise Augmented Lagrangian with respect to \(\mathbf{y}\).

obfn_reg()[source]

Compute regularisation terms and contribution to objective function. Regularisation terms are \(\| Y \|_1\) and \(\| Y \|_{2,1}\).

class sporco.admm.pdcsc.ConvProdDictL1L1Grd(*args, **kwargs)[source]

Bases: ConvL1L1Grd

ADMM algorithm for a Convolutional Sparse Coding problem for multi-channel signals with a dictionary consisting of a product of convolutional and standard dictionaries and with an \(\ell_1\) data fidelity term and both \(\ell_1\) and \(\ell_2\) of gradient regularisation terms [25].

Solve the optimisation problem

\[\mathrm{argmin}_X \; \left\| D X B^T - S \right\|_1 + \lambda \| X \|_1 + (\mu / 2) \sum_i \| G_i X \|_2^2\]

where \(D\) is a convolutional dictionary, \(B\) is a standard dictionary, \(G_i\) is an operator that computes the gradient along array axis \(i\), and \(S\) is a multi-channel input image with

\[S = \left( \begin{array}{ccc} \mathbf{s}_0 & \mathbf{s}_1 & \ldots \end{array} \right) \;.\]

where the signal channels form the columns, \(\mathbf{s}_c\), of \(S\). This problem is solved via the ADMM problem [25]

\[\mathrm{argmin}_{X,Y} \; \left\| Y_0 \right\|_1 + \lambda \| Y_1 \|_1 + (\mu / 2) \sum_i \| G_i X \|_2^2 \quad \text{such that} \quad Y_0 = D X B^T - S \;\;\; Y_1 = X \;\;.\]
Parameters:
Darray_like

Dictionary matrix

Barray_like

Standard dictionary array

Sarray_like

Signal vector or matrix

lmbdafloat

Regularisation parameter (l1)

mufloat

Regularisation parameter (gradient)

Warray_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).

optConvProdDictL1L1Grd.Options object

Algorithm options

dimK0, 1, optional (default 0)

Number of dimensions in input signal corresponding to multiple independent signals

dimNint, optional (default 2)

Number of spatial dimensions

block_sep0(Y)[source]

Separate variable into component corresponding to \(\mathbf{y}_0\) in \(\mathbf{y}\;\;\).

block_sep1(Y)[source]

Separate variable into component corresponding to \(\mathbf{y}_1\) in \(\mathbf{y}\;\;\).

block_cat(Y0, Y1)[source]

Concatenate components corresponding to \(\mathbf{y}_0\) and \(\mathbf{y}_1\) to form \(\mathbf{y}\;\;\).

cnst_A0(X, Xf=None)[source]

Compute \(A_0 \mathbf{x}\) component of ADMM problem constraint.

cnst_A0T(Y0)[source]

Compute \(A_0^T \mathbf{y}_0\) component of \(A^T \mathbf{y}\) (see ADMMTwoBlockCnstrnt.cnst_AT).

setdict(D=None, B=None)[source]

Set dictionary array.

xstep()[source]

Minimise Augmented Lagrangian with respect to \(\mathbf{x}\).

rhochange()[source]

Updated cached c array when rho changes.

reconstruct(X=None)[source]

Reconstruct representation.

rsdl_s(Yprev, Y)[source]

Compute dual residual vector.

rsdl_sn(U)[source]

Compute dual residual normalisation term.

class sporco.admm.pdcsc.ConvProdDictL1L1GrdJoint(*args, **kwargs)[source]

Bases: ConvProdDictL1L1Grd

ADMM algorithm for a Convolutional Sparse Coding problem for multi-channel signals with a dictionary consisting of a product of convolutional and standard dictionaries and with an \(\ell_1\) data fidelity term and \(\ell_{2,1}\), and \(\ell_2\) of gradient regularisation terms [25].

Solve the optimisation problem

\[\mathrm{argmin}_X \; \left\| D X B^T - S \right\|_1 + \lambda \| X \|_{2,1} + (\mu / 2) \sum_i \| G_i X \|_2^2\]

where \(D\) is a convolutional dictionary, \(B\) is a standard dictionary, \(G_i\) is an operator that computes the gradient along array axis \(i\), and \(S\) is a multi-channel input image with

\[S = \left( \begin{array}{ccc} \mathbf{s}_0 & \mathbf{s}_1 & \ldots \end{array} \right) \;.\]

where the signal channels form the columns, \(\mathbf{s}_c\), of \(S\). This problem is solved via the ADMM problem [25]

\[\mathrm{argmin}_{X,Y} \; \left\| Y_0 \right\|_1 + \lambda \| Y_1 \|_{2,1} + (\mu / 2) \sum_i \| G_i X \|_2^2 \quad \text{such that} \quad Y_0 = D X B^T - S \;\;\; Y_1 = X \;\;.\]
Parameters:
Darray_like

Dictionary matrix

Barray_like

Standard dictionary array

Sarray_like

Signal vector or matrix

lmbdafloat

Regularisation parameter (l2,1)

mufloat

Regularisation parameter (gradient)

Warray_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).

optConvProdDictL1L1GrdJoint.Options object

Algorithm options

dimK0, 1, or None, optional (default None)

Number of dimensions in input signal corresponding to multiple independent signals

dimNint, optional (default 2)

Number of spatial dimensions

class Options(opt=None)[source]

Bases: Options

ConvBPDNJoint algorithm options

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

L21Weight : An array of weights for the \(\ell_{2,1}\) norm. The array shape must be such that the array is compatible for multiplication with the X/Y variables after the sum over axisC performed during the computation of the \(\ell_{2,1}\) norm. If this option is defined, the regularization term is \(\mu \sum_i w_i \sqrt{ \sum_c \mathbf{x}_{i,c}^2 }\) where \(w_i\) are the elements of the weight array, subscript \(c\) indexes the channel axis and subscript \(i\) indexes all other axes.

Parameters:
optdict or None, optional (default None)

ConvL1L1Grd algorithm options

defaults = {'AbsStopTol': 0.0, 'AutoRho': {'AutoScaling': False, 'Enabled': False, 'Period': 10, 'RsdlRatio': 10.0, 'RsdlTarget': None, 'Scaling': 2.0, 'StdResiduals': False}, 'AuxVarObj': False, 'Callback': None, 'DataType': None, 'FastSolve': False, 'GradWeight': 1.0, 'HighMemSolve': False, 'IterTimer': 'solve', 'L1Weight': 1.0, 'L21Weight': 1.0, 'LinSolveCheck': False, 'MaxMainIter': 1000, 'NoBndryCross': False, 'NonNegCoef': False, 'RelStopTol': 0.001, 'RelaxParam': 1.8, 'ReturnVar': 'Y1', 'ReturnX': True, 'StatusHeader': True, 'U0': None, 'Verbose': False, 'Y0': None, 'fEvalX': True, 'gEvalY': False, 'rho': 1.0}

Default content and allowed dict keys

itstat_fields_objfn = ('ObjFun', 'DFid', 'RegL21', 'RegGrad')

Fields in IterationStats associated with the objective function; see eval_objfn

hdrtxt_objfn = ('Fnc', 'DFid', 'Regℓ21', 'Regℓ2∇')

Display column headers associated with the objective function; see eval_objfn

hdrval_objfun = {'DFid': 'DFid', 'Fnc': 'ObjFun', 'Regℓ21': 'RegL21', 'Regℓ2∇': 'RegGrad'}

Dictionary mapping display column headers in hdrtxt_objfn to IterationStats entries

ystep()[source]

Minimise Augmented Lagrangian with respect to \(\mathbf{y}\).

obfn_g1(Y1)[source]

Compute \(g_1(\mathbf{y_1})\) component of ADMM objective function.