sporco.dictlrn.wbpdndl¶
Dictionary learning based on weighted BPDN sparse coding
Classes
|
Dictionary learning based on weighted BPDN and CnstrMOD |
Class Descriptions¶
- class sporco.dictlrn.wbpdndl.WeightedBPDNDictLearn(*args, **kwargs)[source]¶
Bases:
DictLearnDictionary learning based on weighted BPDN and CnstrMOD
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.WeightedBPDNandpgm.cmod.WeightedCnstrMODproblems. 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
solvemethod, attributeitstatis a list of tuples representing statistics of each iteration. The fields of the named tupleIterationStatsare:
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
- opt
WeightedBPDNDictLearn.OptionsobjectAlgorithm options
- class Options(opt=None)[source]¶
Bases:
OptionsBPDN 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: Optionssporco.pgm.bpdn.WeightedBPDN.Options
CMOD: Optionssporco.pgm.cmod.WeightedCnstrMOD.Options
- Parameters:
- optdict or None, optional (default None)
WeightedBPDNDictLearn algorithm options
- defaults = {'AccurateDFid': False, 'BPDN': {'AutoStop': {'Enabled': False, 'Tau0': 0.01}, 'Backtrack': None, 'Callback': None, 'DataType': None, 'FastSolve': False, 'IterTimer': 'solve', 'L': 500.0, 'L1Weight': 1.0, 'MaxMainIter': 1000, 'Momentum': <sporco.pgm.momentum.MomentumNesterov object>, 'Monotone': False, 'NonNegCoef': False, 'RelStopTol': 0.001, 'StatusHeader': True, 'StepSizePolicy': None, 'Verbose': False, 'X0': None}, 'CMOD': {'AutoStop': {'Enabled': False, 'Tau0': 0.01}, 'Backtrack': None, 'Callback': None, 'DataType': None, 'FastSolve': False, 'IterTimer': 'solve', 'L': 500.0, 'MaxMainIter': 1000, 'Momentum': <sporco.pgm.momentum.MomentumNesterov object>, 'Monotone': False, 'NonNegCoef': False, 'RelStopTol': 0.001, 'StatusHeader': True, 'StepSizePolicy': None, 'Verbose': False, 'X0': None, 'ZeroMean': False}, 'Callback': None, 'IterTimer': 'solve', 'MaxMainIter': 1000, 'StatusHeader': True, 'Verbose': False}¶
Default content and allowed dict keys