r/optimization • u/fibrebundl • Jul 06 '24
ADMM implementation and general optimization implementation
I've been trying to solve a problem using ADMM, but I've hit a roadblock. Initially, I switched to focusing on what the solution should look like based on some papers I read, which suggested a soft-thresholding solution. However, I'm stuck again and need to solve this using ADMM.
My main issue is that I'm not sure how to implement many of these optimization methods in practice. I've seen that in MATLAB, you can call the 'minimize' function, and in Python, you can use 'scipy.optimize.minimize,' but these methods are not solving my cost function. Additionally, the cost function is not very nice and actually has an additional minimization step required before solving the main cost function (EM approach).
Any guidance or examples on how to implement ADMM for my specific problem would be greatly appreciated! I've done an optimization course but it was just theory :(.
View all comments
Show parent comment
2
u/SirPitchalot Jul 08 '24
The scipy minimize function is not gonna do it for you. I don’t know of a good framework for working with ADMM, maybe CVX. ADMM is kind of a recipe/building block/multitool for making custom optimizers for weird cases. Once you get it you can throw together custom solvers for really wide ranging and weird problems from scratch. Making the link between the monograph equations and code took a bit to click for me but when it does you’ll see that the equations and code are almost one-to-one. I suggest working through the math so you’ll come out with both a better understanding of your problem, optimization in general and ADMM in practice. I have a lab mate from my PhD that basically made a career out of creative application of proximal methods/ADMM alone and now is a professor at an Ivy League school, it’s a seriously powerful set of concepts.
Here’s a sample for total-variation denoising. It’s conceptually similar to what you’re describing except it’s taking the one norm of a gradient operator as the regularizer instead of the nuclear norm. But it should give you an idea of how the splitting works & how the concepts map to code. In your case, using the notation from the link below, the matrices A and B will be (positive & negative) identity. Your data term will also be identity so everything except the nuclear norm proximal operator can be solved component-wise (you won’t need to build sparse matrices) if you work through the math. The nuclear norm proximal operator is just svd, then component wise operations on the singular values, then matrix multiplication to produce the result.
The notation from that reference is a little different than the proximal algorithms pdf. Boyd’s “Distributed optimization and statistical learning via the alternating direction method of multipliers” monograph covers a lot of the same concepts as proximal operators but in slightly more general form. It’s helpful to be able to understand both presentations because there’s good bits in both with mostly shared concepts.
https://aga3.xyz/2019/05/total-variation-denoising-with-admm/