L1 convex optimization with equality constraints in python
问题 I need to minimize L_1(x) subject to Mx = y. x is a vector with dimension b, y is a vector with dimension a, and M is a matrix with dimensions (a,b). After some reading I determined to use scipy.optimize.minimize: import numpy as np from scipy.optimize import minimize def objective(x): #L_1 norm objective function return np.linalg.norm(x,ord=1) constraints = [] #list of all constraint functions for i in range(a): def con(x,y=y,i=i): return np.matmul(M[i],x)-y[i] constraints.append(con) #make