L1-norm Minimization
I am trying to minimize the following function using Linear programming. I am unable to include the image of my objective function. Click this Objective Function to view what I am
Solution 1:
import cvxpy as cp
import numpy as np
N=10
M=100
U = np.random.random((M,N))
m = np.random.random(M)
t = cp.Variable(M)
x = cp.Variable(N)
prob = cp.Problem(cp.Minimize(cp.sum(t)), [-t<=U@x-m, U@x-m<=t])
optimal_value = prob.solve()
print("t=",t.value)
print("x=",x.value)
print("val=",optimal_value)
Solution 2:
There is the minimization method for the scipy library's optimization method. I am unsure how you would go about finding the L1-Norm but perhaps this will help with the minimization.
Each word listed in the () after minimize is a parameter. The "fun" parameter is the for a function and is where you'd put the L1-Norm after you've found it using another method.
scipy.optimize.minimize(
fun, x0, args=(), method='BFGS',
jac=None, hess=None, hessp=None, bounds=None,
constraints=(), tol=None, callback=None, options=None
)
Post a Comment for "L1-norm Minimization"