sporco.admm.cbpdnin¶
Class for ADMM algorithm for convolutional sparse coding with inhibition terms
Classes
|
ADMM algorithm for Convolutional BPDN with inhibition via weighted \(\ell_{1}\) norm terms [17] |
Class Descriptions¶
- class sporco.admm.cbpdnin.ConvBPDNInhib(*args, **kwargs)[source]¶
Bases:
ConvBPDN
ADMM algorithm for Convolutional BPDN with inhibition via weighted \(\ell_{1}\) norm terms [17]
Solve the optimisation problem
\[\mathrm{argmin}_\mathbf{x} \; (1/2) \left\| \sum_m \mathbf{d}_m * \mathbf{x}_m - \mathbf{s} \right\|_2^2 + \lambda \sum_m \| \mathbf{x}_m \|_1 + \mu \sum_m \boldsymbol{\omega}^T_m | \mathbf{x}_m | + \gamma \sum_m \mathbf{z}^T_m | \mathbf{x}_m |\]for input image \(\mathbf{s}\), dictionary filters \(\mathbf{d}_m\), and coefficient maps \(\mathbf{x}_m\), via the ADMM problem
\[\mathrm{argmin}_{\mathbf{x}, \mathbf{y}} \; (1/2) \left\| \sum_m \mathbf{d}_m * \mathbf{x}_m - \mathbf{s} \right\|_2^2 + \lambda \sum_m \| \mathbf{y}_m \|_1 + \mu \sum_m \boldsymbol{\omega}^T_m | \mathbf{y}_m | + \gamma \sum_m \mathbf{z}^T_m | \mathbf{y}_m | \quad \text{such that} \quad \mathbf{x}_m = \mathbf{y}_m \;\;.\]Here, \(\boldsymbol{\omega}^T_m = \sum_n c_{m,n} (| \mathbf{x}_n * \mathbf{h} |)^T\) and \(\mathbf{z}^T_m = \sum_m (| \mathbf{x}_m * \mathbf{h}' |)^T\), where \(c_{m,n}\) is a square matrix with non-zero entries where elements \(m\) and \(n\) share the same group and \(m != n\), \(\mathbf{h}\) is a spatial weighting matrix non-zero around the origin with radius \(\frac{T}{2}\), and \(\mathbf{h}'\) is the same matrix with zero at the origin.
After termination of the
solve
method, attributeitstat
is a list of tuples representing statistics of each iteration. The fields of the named tupleIterationStats
are:
Iter
: Iteration number
ObjFun
: Objective function value
DFid
: Value of data fidelity term \((1/2) \| \sum_m \mathbf{d}_m * \mathbf{x}_m - \mathbf{s} \|_2^2\)
RegL1
: Value of regularisation term \(\sum_m \| \mathbf{x}_m \|_1\)
RegLat
: Value of regularisation term \(\sum_m \boldsymbol{\omega}^T_m | \mathbf{x}_m |\)
RegSelf
: Value of regularisation term \(\sum_m \mathbf{z}^T_m | \mathbf{x}_m |\)
PrimalRsdl
: Norm of primal residual
DualRsdl
: Norm of dual residual
EpsPrimal
: Primal residual stopping tolerance \(\epsilon_{\mathrm{pri}}\)
EpsDual
: Dual residual stopping tolerance \(\epsilon_{\mathrm{dua}}\)
Rho
: Penalty parameter
XSlvRelRes
: Relative residual of X step solver
Time
: Cumulative run timeThis class supports an arbitrary number of spatial dimensions, dimN, with a default of 2. The input dictionary D is either dimN + 1 dimensional, in which case each spatial component (image in the default case) is assumed to consist of a single channel, or dimN + 2 dimensional, in which case the final dimension is assumed to contain the channels (e.g. colour channels in the case of images). 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). Determination of problem dimensions is handled by
cnvrep.CSC_ConvRepIndexing
.Call graph
- Parameters:
- Darray_like
Dictionary array
- Sarray_like
Signal array
- Wgarray_like
Ng x M grouping matrix with rows representing groups where non-zero values indicate strength of element membership - dimensionality of input signal does not affect the shape of this matrix
- Whn: int
Diameter of inhibition window (in samples) across each dimension
- win_args: tuple
Window function parameters for inhibition window, passed to
scipy.signal.get_window
- lmbdafloat
Regularisation parameter for sparsity
- mufloat
Regularisation parameter for lateral inhibition - this discourages grouped elements from being active within the same windowed area
- gammafloat
Regularisation parameter for self inhibition - this discourages single elements from being active more than once within the same windowed area, leading to more impulse-like activations
- opt
ConvBPDNInhib.Options
objectAlgorithm 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
- class Options(opt=None)[source]¶
Bases:
Options
ConvBPDNInhib algorithm options
Options include all of those defined in
admm.cbpdn.ConvBPDN.Options
, together with additional options:
SmoothWeight
: Smoothing for the weighted \(\ell_1\) norms. The value acts as the percentage of the previous weights to superimpose with the new weights before iterating.
- Parameters:
- optdict or None, optional (default None)
ConvBPDNInhib algorithm options
- defaults = {'AbsStopTol': 0.0, 'AutoRho': {'AutoScaling': True, 'Enabled': True, 'Period': 1, 'RsdlRatio': 1.2, 'RsdlTarget': None, 'Scaling': 1000.0, 'StdResiduals': False}, 'AuxVarObj': False, 'Callback': None, 'DataType': None, 'FastSolve': False, 'HighMemSolve': False, 'IterTimer': 'solve', 'L1Weight': 1.0, 'LinSolveCheck': False, 'MaxMainIter': 1000, 'NoBndryCross': False, 'NonNegCoef': False, 'RelStopTol': 0.001, 'RelaxParam': 1.8, 'ReturnX': False, 'SmoothWeight': 0.9, 'StatusHeader': True, 'U0': None, 'Verbose': False, 'Y0': None, 'fEvalX': True, 'gEvalY': False, 'rho': None}¶
Default content and allowed dict keys
- itstat_fields_objfn = ('ObjFun', 'DFid', 'RegL1', 'RegLat', 'RegSelf')¶
Fields in IterationStats associated with the objective function; see
eval_objfn
- hdrtxt_objfn = ('Fnc', 'DFid', 'Regℓ1', 'RegLat', 'RegSelf')¶
Display column headers associated with the objective function; see
eval_objfn
- hdrval_objfun = {'DFid': 'DFid', 'Fnc': 'ObjFun', 'RegLat': 'RegLat', 'RegSelf': 'RegSelf', 'Regℓ1': 'RegL1'}¶
Dictionary mapping display column headers in
hdrtxt_objfn
to IterationStats entries
- solve()¶
Call graph