简体   繁体   English

放宽线性约束?

[英]Relaxation of linear constraints?

When we need to optimize a function on the positive real half-line, and we only have non-constraints optimization routines, we use y = exp(x) , or y = x^2 to map to the real line and still optimize on the log or the (signed) square root of the variable.当我们需要在正实数半线上优化一个函数,而我们只有非约束优化例程时,我们使用y = exp(x) ,或y = x^2映射到实线上并仍然优化变量的对数或(有符号)平方根。

Can we do something similar for linear constraints, of the form Ax = b where, for xa d-dimensional vector, A is a (N,n) -shaped matrix and b is a vector of length N , defining the constraints ?我们可以对线性约束做一些类似的事情,形式为Ax = b其中,对于 xa d 维向量, A(N,n)形矩阵, b是长度为N的向量,定义约束?

While, as Ervin Kalvelaglan says this is not always a good idea, here is one way to do it.虽然,正如 Ervin Kalvelaglan 所说,这并不总是一个好主意,但这是一种方法。 Suppose we take the SVD of A, getting假设我们取 A 的 SVD,得到

A = U*S*V'
where if A is n x m
U is nxn orthogonal,
S is nxm, zero off the main diagonal, 
V is mxm orthogonal

Computing the SVD is not a trivial computation.计算 SVD 不是一项简单的计算。

We first zero out the elements of S which we think are non-zero just due to noise -- which can be a slightly delicate thing to do.我们首先将 S 的元素归零,因为噪声我们认为这些元素是非零的——这可能是一件有点微妙的事情。

Then we can find one solution x~ to然后我们可以找到一个解决方案 x~

A*x = b 

as作为

x~ = V*pinv(S)*U'*b

(where pinv(S) is the pseudo inverse of S, ie replace the non zero elements of the diagonal by their multiplicative inverses) (其中 pinv(S) 是 S 的伪逆,即用它们的乘法逆替换对角线的非零元素)

Note that x~ is a least squares solution to the constraints, so we need to check that it is close enough to being a real solution, ie that Ax~ is close enough to b -- another somewhat delicate thing.请注意,x~ 是约束的最小二乘解,因此我们需要检查它是否足够接近成为真正的解,即 Ax~ 是否足够接近 b —— 另一个有点微妙的事情。 If x~ doesn't satisfy the constraints closely enough you should give up: if the constraints have no solution neither does the optimisation.如果 x~ 没有足够接近地满足约束,您应该放弃:如果约束没有解决方案,优化也没有。

Any other solution to the constraints can be written x = x~ + sum c[i]*V[i] where the V[i] are the columns of V corresponding to entries of S that are (now) zero.约束的任何其他解决方案都可以写成 x = x~ + sum c[i]*V[i] 其中 V[i] 是 V 的列,对应于(现在)为零的 S 的条目。 Here the c[i] are arbitrary constants.这里 c[i] 是任意常数。 So we can change variables to using the c[] in the optimisation, and the constraints will be automatically satisfied.因此,我们可以在优化中将变量更改为使用 c[],并且约束将自动满足。 However this change of variables could be somewhat irksome!然而,这种变量的变化可能有点令人厌烦!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM