sporco.dictlrn.wbpdndl

Dictionary learning based on weighted BPDN sparse coding

Classes

WeightedBPDNDictLearn(*args, **kwargs)

Dictionary learning based on weighted BPDN and CnstrMOD


Class Descriptions

class sporco.dictlrn.wbpdndl.WeightedBPDNDictLearn(*args, **kwargs)[source]

Bases: sporco.dictlrn.dictlrn.DictLearn

Dictionary learning based on weighted BPDN and CnstrMOD


Inheritance diagram of WeightedBPDNDictLearn


Solve the optimisation problem

\[\mathrm{argmin}_{D, X} \; (1/2) \| D X - S \|_W^2 + \lambda \| X \|_1 \quad \text{such that} \quad \|\mathbf{d}_m\|_2 = 1\]

via interleaved alternation between the PGM steps of the pgm.bpdn.WeightedBPDN and pgm.cmod.WeightedCnstrMOD problems. Note that \(\| \cdot \|_W\) denotes a non-standard definition of the weighted Frobenius norm defined as

\[\| X \|_W^2 = \| W^{1/2} \odot X \|_F\]

so that

\[\| X \|_W^2 = \sum_i \| W_i^{1/2} \mathbf{x}_i \|_2^2 = \sum_i \| \mathbf{x}_i \|_{W_i}^2 \;,\]

where \(\mathbf{x}_i\) and \(\mathbf{w}_i\) are the \(i^{\text{th}}\) columns of \(X\) and \(W\) respectively, and \(W_i = \mathrm{diag}(\mathbf{w}_i)\).

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) \| D X - S \|_W^2\)

RegL1 : Value of regularisation term \(\| X \|_1\)

Cnstr : Constraint violation measure

XRsdl : Norm of X residual

XL : X inverse of gradient step parameter

DRsdl : Norm of D residual

DL : D inverse of gradient step parameter

Time : Cumulative run time

Parameters
D0array_like, shape (N, M)

Initial dictionary matrix

Sarray_like, shape (N, K)

Signal vector or matrix

lmbdafloat

Regularisation parameter

Warray_like, shape (N, K)

Weight matrix

optWeightedBPDNDictLearn.Options object

Algorithm options

class Options(opt=None)[source]

Bases: sporco.dictlrn.dictlrn.DictLearn.Options

BPDN dictionary learning algorithm options.

Options include all of those defined in sporco.dictlrn.dictlrn.DictLearn.Options, together with additional options:

AccurateDFid : Flag determining whether data fidelity term is estimated from the value computed in the X update (False) or is computed after every outer iteration over an X update and a D update (True), which is slower but more accurate.

BPDN : Options sporco.pgm.bpdn.WeightedBPDN.Options

CMOD : Options sporco.pgm.cmod.WeightedCnstrMOD.Options

Parameters
optdict or None, optional (default None)

WeightedBPDNDictLearn algorithm options

evaluate()[source]

Evaluate functional value of previous iteration