You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ECOS solver failed to converge on a fairly simple problem. As far as I can tell, the problem is well-conditioned and well-scaled, with coefficients, variables and objective function value between -10 and 10. The issue may be reproduced below:
import numpy as np
import cvxpy as cvx
np.random.seed(2)
n = 3000
alpha = np.random.normal(size=n)
sigma = np.ones(n) * 10
w = cvx.Variable(n)
objective = cvx.Maximize(w.T @ alpha - 0.5 * cvx.norm(cvx.multiply(sigma, w), 2))
constraints = [
cvx.norm(w, 1) <= 1,
w <= 1,
w >= -1
]
# this problem fails
problem = cvx.Problem(objective, constraints)
problem.solve(solver=cvx.ECOS, verbose=True)
# however this equivalent problem with rescaled objective works
objective_2 = cvx.Maximize(w.T @ (alpha / 2) - 0.5 * cvx.norm(cvx.multiply(sigma / 2, w), 2))
problem_2 = cvx.Problem(objective_2, constraints)
problem_2.solve(solver=cvx.ECOS, verbose=True)
I understand that the -1 <= w <= 1 constraints are redundant in this case, but these box constraints are part of my more general problem. In other cases that I have tested with some of these binding, I have also occasionally encountered similar failures.
I am using CVXPY 1.1.1 with ECOS solver 2.0.7 and Numpy 1.16.5, on Python 3.7.4.
Shown below is the verbose output from the first and second problems:
The ECOS solver failed to converge on a fairly simple problem. As far as I can tell, the problem is well-conditioned and well-scaled, with coefficients, variables and objective function value between -10 and 10. The issue may be reproduced below:
I understand that the -1 <= w <= 1 constraints are redundant in this case, but these box constraints are part of my more general problem. In other cases that I have tested with some of these binding, I have also occasionally encountered similar failures.
I am using CVXPY 1.1.1 with ECOS solver 2.0.7 and Numpy 1.16.5, on Python 3.7.4.
Shown below is the verbose output from the first and second problems:
The text was updated successfully, but these errors were encountered: