cvxpy | embedded modeling language for convex optimization problems
kandi X-RAY | cvxpy Summary
kandi X-RAY | cvxpy Summary
A Python-embedded modeling language for convex optimization problems.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of cvxpy
cvxpy Key Features
cvxpy Examples and Code Snippets
Community Discussions
Trending Discussions on cvxpy
QUESTION
ANSWER
Answered 2022-Mar-29 at 19:14Your problem is solved exactly because you don't have any constraint. I skipped the function to make you a shorter script.
QUESTION
I try to solve the convex problem on page 20 presented in this paper
In my opinion, the objective is convex.
cvxpy version 1.1.18
prob is DCP: False
it reports
xception has occurred: DCPError Problem does not follow DCP rules. Specifically: The objective is not DCP. Its following subexpressions are not: 0.004 / (power(var1[0], 0.5) + power(var1[0], 0.5)) 0.004 / (power(var11, 0.5) + power(var11, 0.5))
my code is
...ANSWER
Answered 2022-Mar-28 at 08:48Use cp.inv_pos(u)
instead of 1/u
.
QUESTION
We are using Mosek solver via its Cvxpy interface.
We deal with large-scale optimization problem on a regular-basis and sometimes the runtime is very high. So, we specify a upper limit on runtime using Mosek's mosek.dparam.optimizer_max_time
parameter.
In those cases, the pain-point is that we get no solution.
Is it possible to get the suboptimal/best found solution so far?
...ANSWER
Answered 2022-Feb-24 at 07:24If Mosek did not find any feasible integer solution within the time limit then there is nothing to return, so you get nothing.
If Mosek found some feasible integer solution then CVXPY should return it with solution status s.OPTIMAL_INACCURATE, judging from a quick look at the code.
So the question is what does it say in the log output and what happens at the end of the optimization when CVXPY is processing the answer from the solver.
QUESTION
I am solving the currency exchange problem, where we have a set of currency holdings for 10 different kinds. Our objective is to have a specific minimum of each currency holdings, while minimizing the loss due to the bid-ask spread which occurs when we exchange some units of a currency for some units of another currency.
In case it helps here is the full question: https://drive.google.com/file/d/1DG8xfM3ayQ0Oj9VQGYSNbHF_rbKHMTLq/view
The code:
...ANSWER
Answered 2022-Jan-23 at 20:58Wherever you are operating on cvxpy objects you should be using cp.
functions, not np.
ones. So cp.dot
etc.
QUESTION
Previously I used command conda install -c mosek mosek
to install mosek(my IDE is VS Code and use anaconda environment). After I installed it, I ran a program for a convex optimization problem, and one line of code was(because I want to choose mosek as solver):
ANSWER
Answered 2022-Jan-10 at 08:49Have you tested that your conda installed Mosek can be used outside Cvxpy i.e. directly from Python.
QUESTION
ANSWER
Answered 2022-Jan-06 at 16:16I found success in customizing this library for modern use.
QUESTION
First of all, I'm sorry if my questions doesn't make sens, I am new using CVXPY library and I don't understand everything :/
I am trying to solve a minimization problem that I thought would be easy handle. I got a matrix S dimensions (9,7) with known coefficients, B dimensions (1,7) with known coefficients, Alpha dimensions (1,7) what I need to find, with various constraints :
- Alpha must be positive
- The sum of all the coefficients of Alpha must be equal to 1
I need to optimize Alpha such as : A @ Alpha-B=0. I discovered CVXPY and thought least square optimization was perfect for this issue.
This is the code I wrote :
...ANSWER
Answered 2022-Jan-03 at 14:35Use just sum(Alpha) == 1
. You are not supposed to use numpy
functions in CVXPY expressions, you must use CVXPY functions listed in https://www.cvxpy.org/tutorial/functions/index.html
QUESTION
ANSWER
Answered 2021-Nov-25 at 16:15I think CVXPY does not understand that both y - X*theta
are the same in
QUESTION
I'm trying to solve the following problem in CVXPY.
The problem is a mixed-integer SDP due to the PSD matrix we're solving. However, according to this list it looks as though none of the solvers can handle such a problem.
Can we use the fact that A
is a 2x2 matrix to somehow convert this to a mixed-integer SOCP problem?
ANSWER
Answered 2021-Nov-24 at 09:08Let's say A=[[x,z], [z,y]]
, then you can maximize sqrt(det(A))
(which is equivalent to your objective). Note that
QUESTION
data source: https://catalog.data.gov/dataset/nyc-transit-subway-entrance-and-exit-data
I tried looking for a similar problem but I can't find an answer and the error does not help much. I'm kinda frustrated at this point. Thanks for the help. I'm calculating the closest distance from a point.
...ANSWER
Answered 2021-Oct-11 at 14:21geopandas 0.10.1
- have noted that your data is on kaggle, so start by sourcing it
- there really is only one issue
shapely.geometry.MultiPoint()
constructor does not work with a filtered series. Pass it a numpy array instead and it works. - full code below, have randomly selected a point to serve as
gpdPoint
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install cvxpy
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page