cvxpy

cvxpy/ecos pip installation error

不打扰是莪最后的温柔 提交于 2020-01-03 04:32:13
问题 This is a borderline SuperUser question. I've been using pip install <x> to add packages to my 3.6.2 installation, from powershell on Windows 10. I'm struggling to install CVXPY. Specifically, I've already upgraded setuptools and installed visual studio c++ 14. Also, I installed C++ 2008 as suggested by a github user: https://github.com/embotech/ecos/issues/53. But, I couldn't implement her other suggestion (edit ecosmodules.c) because I dont think that file exists in the raw package I

Install Python Packages in Azure ML?

[亡魂溺海] 提交于 2019-12-29 07:04:33
问题 Similar question as here but now on Python packages. Currently, the CVXPY is missing in Azure ML. I am also trying to get other solvers such as GLPK, CLP and COINMP working in Azure ML. How can I install Python packages in Azure ML? Update about trying to install the Python packages not found in Azure ML. I did as instructed by Peter Pan but I think the 32bits CVXPY files are wrong for the Anaconda 4 and Python 3.5 in Azure ML, logs and errors are here. [Information] Running with Python 3.5.1

Linear Programming with cvxpy

戏子无情 提交于 2019-12-25 20:05:53
问题 I would like to ask you regarding on the Linear Program for optimization. I have an objective function, and constraint functions as below, variables(x1, x2, x3, x4, x5, x6) are quantities of the products, and the quantities of products have to be fixed numbers now. the goal of this problem is the optimizing the quantities of products. Objective Function (c.T * [x1, x2, x3, x4, x5, x6]) [[c11, c12, c13, c14, c15 c16], [c21, c22, c23, c24, c25, c26], X [x1, x2, x3, x4, x5, x6] [c31, c32, c33,

TypeEror in cvxpy: float() argument must be a string or a number, not 'Inequality'

感情迁移 提交于 2019-12-24 20:44:05
问题 Still playing with cvxpy. This time I get an interesting error. Let us look at this minimal code import cvxpy as cp import numpy as np A = np.random.normal(0, 1, (64,6)) b = np.random.normal(0, 1, (64,1)) theta = cp.Variable(shape = (6,1)) prob = cp.Problem( cp.Minimize(cp.max(A*theta -b) <= 5), [-10 <= theta, theta <= 10]) Once compiled, we get the error ~\Anaconda3\lib\site-packages\cvxpy\expressions\constants\constant.py in __init__(self, value) 42 self._sparse = True 43 else: ---> 44 self

Constraints do not follow DCP rules in CVXPY

痞子三分冷 提交于 2019-12-24 09:41:38
问题 I want to solve this problem using CVXPY but I don't know why I get the following error message: DCPError: Problem does not follow DCP rules. I guess my constraints are not DCP. Is there any way to model this in DCP? n_k = [10000, 20000] request_rate = [15, 10] p_k_1 = np.random.rand(n_k[0]) p_k_2 = np.random.rand(n_k[1]) #params p_k_param_1 = cvx.Parameter(1, n_k[0], sign="positive") p_k_param_1 = np.array(p_k_1) p_k_param_2 = cvx.Parameter(1, n_k[1], sign="positive") p_k_param_2 = np.array

cvxpy:'sum_entries' is not defined

馋奶兔 提交于 2019-12-24 07:16:03
问题 I am trying to resolve a portfolio optimization problem in Python using CVXPY but getting an error sum_entries is not defined. I am using Anaconda 2.7 and Jupyter notebook. I have installed cvxpy, msgpack, argpack and cvxopt using conda pip install. Below is the snippet of the code. Any suggestions? w=Variable(len(CovMatrix)) risk=quad_form(w,Sigma) constraints=[] constraints.append(w>=0) constraints.append(sum_entries(w)==1) prob=Problem(cvx.Minimize(risk),constraints) prob.solve(solver=

CVXPY: how to efficiently solve a series of similar problems

可紊 提交于 2019-12-23 15:56:59
问题 I have a large problem defined in CVXPY modelling language. I want to solve series of this problems - still the same format but with different parameters (constants). I found out that after calling problem.solve() internal problem generating takes 20 s and main optimization runtime takes 0.2 s. It's a lot of time when I want to solve dozens of similar problems. Is there any tool for CVXPY like YALMIP optimizer or any possibility to reduce problem generating time? 回答1: Yes there is. And it's

Passing CPLEX Parameters to CVXPY

空扰寡人 提交于 2019-12-18 09:39:06
问题 How do i pass tolerances and other parameters through CVXPY when using the CPLEX solver? from cvxpy import Problem, Minimize from cvxpy.settings import CPLEX costs = ... constraints = ... prob = Problem(Minimize(costs), constraints) prob.solve(solver=CPLEX, ...) I see a page of CPLEX Parameters though it is unclear which ones apply to my quadratic problem. Also, the CVXPY documentation has pass through options for other solvers but not CPLEX. 回答1: This will change in the future (see this pull

CVXPY throws SolverError

旧巷老猫 提交于 2019-12-12 18:27:36
问题 When using CVXPY, I frequently get "SolverError". Their doc just says this is caused by numerical issues, but no further information is given about how to avoid them. The following code snippet is an example, the problem is trivial, but the 'CVXOPT' solver just throws "SolverError". It is true that if we change the solver to another one, like 'ECOS', the problem will be solved as expected. But the point is, 'CVXOPT' should in principle solve this trivial problem and it really baffles me why

Define CVXPY variables for graph coloring problem

血红的双手。 提交于 2019-12-11 17:23:07
问题 I’m trying to solve the minimum graph coloring problem. I’m trying to solve it as an mip using cvxpy. I’m following the outline of a solution described in this url: https://manas.tech/blog/2010/09/16/modelling-graph-coloring-with-integer-linear-programming.html I’m not sure if I’m understanding how the cvxpy variables are created correctly, and how I’m defining my constraints. I have sample input data below along with the code creating the variables, constraints, and objective function,