我正在尝试小规模实现https://arxiv.org/abs/1211.5608中概述的算法。我有一个线性运算符定义为在哪里, 在哪里和是不同矩阵的列和向量。
我用它作为解决问题的约束
服从
在 CVXPY 中,我做了约束:
constraints = [cp.trace(np.transpose((B_hat_star[:,col][:,np.newaxis]*np.sqrt(L)*C_hat[col,:])) @ X) == y_hat[col] for col in range(L)]
这有效。但是,现在我试图做出约束:。我不确定如何对使用 for 循环(如上)定义的矩阵强制执行范数约束。我试过做
constraints = [cp.norm([y_hat[col] - cp.trace(np.transpose((B_hat_star[:,col][:,np.newaxis]*np.sqrt(L)*C_hat[col,:])) @ X) for col in range(L)], 2) <= delta],但我收到一条错误消息ValueError: setting an array element with a sequence.