Closed chicanagram closed 5 years ago
That shouldn't be too difficult. There are two main components to setting this up:
sporco.admm.ccmod.ConvCnstrMODBase
or sporco.fista.ccmod.ConvCnstrMOD
.For step 1, all you need to do is derive a custom solver class (from sporco.fista.ccmod.ConvCnstrMOD
might be the simplest option) that overrides the eval_proxop
method (or the ystep
method if you're using one of the solvers in sporco.admm.ccmod
) to enforce your custom requirements such as non-negativity of the atoms. Of course, this assumes that all of your additional priors can be implemented via a single proximal operator (which is fine for the non-negativity, for example). If this isn't the case, then the modifications could be substantially more involved, probably not possible using using the FISTA solver, and requiring a more complicated splitting for the ADMM solver.
For step 2, you could either derive a custom CDL solver from sporco.dictlrn.cbpdndl.ConvBPDNDictLearn
, overriding the __init__
method so that the dstep
attribute is an instance of your custom dictionary update solvers defined in step 1, or follow the example script showing how to use sporco.dictlrn.DictLearn
as a generic dictionary learning solver.
Feel free to follow up if you run into problems or have any additional questions.
Closing the issue on the assumption that the question is resolved. Please re-open if you have additional questions.
I'm using convolutional dictionary learning on noisy vibrational spectroscopy signals. I was wondering if it might be possible to modify ConvBPDNDictLearn with a regularization term, to enforce certain priors on the atoms? For example, we might be interested in setting the boundaries of the atoms to zero (to learn peak-like features), or have non-negative atoms. If so, how would I go about doing that? Thanks!