简体   繁体   中英

to solve non-linear constrained problem in python using l1 minimization

I am Currently working on some optimization problem which involves non-linear constraint. The problem is as follows:

在此处输入图像描述

I need to perform either of the two minimizations shown in image in python. I found library scipy which has optimize.minimize() function but I am unable to fit in the Non-Linear constraint using scipy.NonLinearConstraint. Can anyone guide? How to solve this? Is there also a way to solve it using some homotopy function given in any of the libraries? I have tried (adding constraint for the alternative one)as:

con = lambda A,x,y : np.matmul(A,x) - y
nlc = NonlinearConstraint(con, 0, epsilon)

So, I finally could solve the above optimization by using spgl1 solver in python. It can be used as shown below:

from spgl1 import spgl1, spg_bp, spg_bpdn

#x01 = psueodinverse of A multiplied by y  
x,resid,grad,info = spgl1(A, y, tau = tau, sigma = epsilon, x0 = x01, iter_lim = 150)

one can refer about the above solver at github link or pypi link

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM