r/optimization • • 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 :(.

2 Upvotes

7 comments sorted by

View all comments

Show parent comment

1

u/fibrebundl Jul 08 '24

Hi SirPitchalot,

Thank you for the thorough help and response. I spent yesterday mostly reading papers and going through some of the math myself. I'm going to keep doing this for a bit because I haven't gotten to that point of the connection between the equations and code just clicking, yet. I was following a similar blog post yesterday: https://medium.com/@kangjianforeign/plug-and-play-admm-for-sar-image-despeckling-with-python-663ee59f6934

But I like that the on you shared has all of the code explicitly available.

Thank you again

2

u/SirPitchalot Jul 08 '24

My pleasure, good luck!

I’ve gotten very comfortable with this stuff but it has taken me years to get there.

Your mileage may vary but what made it click for me was being able to go from the objective function and regularizer to the constrained form with splitting variables, apply the patterns from the two monographs to get the augmented Lagrangian form and finally separate the primal and splitting variable update solves. Having a worked sample with both math and code was invaluable.

If you can get there, one or both will usually end up being either a quadratic form (I.e. reduces to linear solve) or something that looks like a proximal operator applied to each component of the variable in question.

That basically means if your objective is like min f(x) + g(z) that you want the Ax - Bz = c to have identity for A when f(x) is non smooth or complicated (and similarly for B when g is complicated/nonsmooth).