问题标签 [cvx]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
3058 浏览

matlab - 如何在不使用循环的情况下在 CVX 中编写约束

我正在使用 matlab 包“CVX”来解决优化问题。目前我正在使用for循环来添加约束,但是我发现在初始化问题时它非常慢。

NoutNin是大小为 n*3 的两个矩阵,我需要矩阵Nout-Nin每一行的范数小于阈值,我怎么能在没有循环的情况下写这个?谢谢!

0 投票
0 回答
1865 浏览

matlab - CVX - matlab - nonlinear constraints

In FMINCON, nonlinear constraints can be provided as a function argument (nonlcon). I tried to use a similar method in CVX

But I get an error:

In the nonlcon, there is an element-wise division operation. It gives the error at that line and I can't change the constraint to any other way. Is there a way to handle this?

0 投票
1 回答
647 浏览

matlab - 如何用 CVX 解决 MMV 稀疏表示

我想用 CVX 工具箱解决多测量向量 (MMV) 稀疏表示问题。我有一个 N*L 矩阵 X。矩阵 X 只有几个非零行。我有方程组Y = A * X。Y 是 M*L 测量矩阵(M

min Relax(X) 服从 Y=A*X

Realx(.) 是将范数 1 应用于向量 t 的函数。(N*1)vector t 由矩阵 X 的每一行的范数 2 组成。即 Relax(X)= norm_1(t) 和 t(i)=norm_2(X(i,:))

我无法将我的目标函数转换为 CVX 可以理解和解决的语言。请告诉我应该如何更改 CVX 可以解决的问题目标和约束。

0 投票
1 回答
673 浏览

matlab - 如何设置 SDP 约束?

Z 是使用 Matlab 的 CVX SDP 代码产生的矩阵变量;如何包含矩阵 Z 元素的值应该为零或一的约束?

有“带状”选项,但它不适用于矩阵。

0 投票
0 回答
926 浏览

matlab - Cannot install CVX

I try to install CVX in MATLAB but it still cannot complete. There are some error massages occurring during installation process. I have attached them already. Please see below

I try to find the solution for this problem in GOOGLE but I cannot find it.

0 投票
1 回答
617 浏览

matlab - 更换 symsum

在 Matlab 的CVX代码中,我们可以使用什么替换来代替 symsum ?我想在不使用循环的情况下使用双重求和,而 symsum 似乎是唯一可用的选项。

0 投票
1 回答
6570 浏览

matlab - Matlab cvx错误与cvx_begin

由于某种原因, cvx对我来说不能开箱即用。

我使用 windows x64、cvx x64 和 Matlab x64 R2012a

但是当我运行一个简单的例子时(\cvx\examples\quickstart.m)它给了我一个错误:

0 投票
1 回答
537 浏览

matlab - 如何进行线性可分二元分类?

我想解决以下优化问题 -

成本函数: 1/2 ||W||^2

服从: Y_i(w.X_i - b) >= 1

其中X是 700x3 矩阵,Y是存储这些实例的类标签(值为 1/-1)的向量,是 和的w.X_i点积。wX_i

我正在使用 CVX -

然后,我正在密谋,w1.x1 + w2.x2 - b 这似乎没有分离超平面?

我在做什么错?

0 投票
4 回答
4400 浏览

matlab - CVX MATLAB 包的稀疏组套索

有谁知道如何使用 CVX 实现稀疏组套索,MATLAB 中的凸优化包?

我不知道如何将公式描述为 CVX 原型。

0 投票
1 回答
2641 浏览

python - 使用 CVX/CVXPY 求解 L2 正则化逻辑回归

我已经尝试了 2-3 天来让 L2 正则化逻辑回归在 Matlab(CVX)和 Python(CVXPY)中工作,但没有成功。我对凸优化还很陌生,所以我很沮丧。以下是我尝试使用 CVX/CVXPY 求解的方程。我从论文 https://intentmedia.github.io/assets/2013-10-09-presenting-at-ieee-big-data/pld_js_ieee_bigdata_2013_admm.pdf中获取了这个等式

在此处输入图像描述

我的 Matlab (CVX) 代码是

CVX 返回一个错误,说这是有道理的,但论文提到了上述等式。我该如何解决?

您的目标函数不是标量。

在尝试了 Matlab 之后,我尝试了 CVXPY。这是python代码

我得到错误

类型错误:尺寸不兼容

所以,我的问题是:我在 CVX/CVXPY 中计算 L2 问题的代码中做错了什么?