sporco.dictlrn.bpdndl

Dictionary learning based on BPDN sparse coding

Classes

BPDNDictLearn(*args, **kwargs)

Dictionary learning based on BPDN and CnstrMOD


Class Descriptions

class sporco.dictlrn.bpdndl.BPDNDictLearn(*args, **kwargs)[source]

Bases: DictLearn

Dictionary learning based on BPDN and CnstrMOD


Inheritance diagram of BPDNDictLearn


Solve the optimisation problem

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

via interleaved alternation between the ADMM steps of the admm.bpdn.BPDN and admm.cmod.CnstrMOD problems.

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 \|_F^2\)

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

Cnstr : Constraint violation measure

XPrRsdl : Norm of X primal residual

XDlRsdl : Norm of X dual residual

XRho : X penalty parameter

DPrRsdl : Norm of D primal residual

DDlRsdl : Norm of D dual residual

DRho : D penalty parameter

Time : Cumulative run time


Call graph

../_images/bpdndl_init.svg

Parameters:
D0array_like, shape (N, M)

Initial dictionary matrix

Sarray_like, shape (N, K)

Signal vector or matrix

lmbdafloat

Regularisation parameter

optBPDNDictLearn.Options object

Algorithm options

class Options(opt=None)[source]

Bases: 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.admm.bpdn.BPDN.Options

CMOD : Options sporco.admm.cmod.CnstrMOD.Options

Parameters:
optdict or None, optional (default None)

BPDNDictLearn algorithm options

defaults = {'AccurateDFid': False, 'BPDN': {'AbsStopTol': 0.0, 'AutoRho': {'AutoScaling': True, 'Enabled': True, 'Period': 10, 'RsdlRatio': 1.2, 'RsdlTarget': None, 'Scaling': 1000.0, 'StdResiduals': False}, 'AuxVarObj': True, 'Callback': None, 'DataType': None, 'FastSolve': False, 'IterTimer': 'solve', 'L1Weight': 1.0, 'LinSolveCheck': False, 'MaxMainIter': 1000, 'NonNegCoef': False, 'RelStopTol': 0.001, 'RelaxParam': 1.8, 'ReturnX': False, 'StatusHeader': True, 'U0': None, 'Verbose': False, 'Y0': None, 'fEvalX': False, 'gEvalY': True, 'rho': None}, 'CMOD': {'AbsStopTol': 0.0, 'AutoRho': {'AutoScaling': False, 'Enabled': True, 'Period': 10, 'RsdlRatio': 10.0, 'RsdlTarget': None, 'Scaling': 2.0, 'StdResiduals': False}, 'AuxVarObj': True, 'Callback': None, 'DataType': None, 'FastSolve': False, 'IterTimer': 'solve', 'MaxMainIter': 1000, 'RelStopTol': 0.001, 'RelaxParam': 1.8, 'ReturnX': False, 'StatusHeader': True, 'U0': None, 'Verbose': False, 'Y0': None, 'ZeroMean': False, 'fEvalX': False, 'gEvalY': True, 'rho': None}, 'Callback': None, 'IterTimer': 'solve', 'MaxMainIter': 1000, 'StatusHeader': True, 'Verbose': False}

Default content and allowed dict keys

evaluate()[source]

Evaluate functional value of previous iteration

solve()

Call graph

../_images/bpdndl_solve.svg