Constrained Optimization

Overview

本教程主要有如下部分组成1: overview of constrained optimization. 2. lagarange solution to this problem. 3. insight to the lagrange solution。
这里写图片描述
从上图可以看出,之前在解决graph优化的时候,我们采用的都是目标函数都是cost function(energy function)。所采用的constraints都是softconstraints。(每一个目标项只是尽可能靠近)。在下面我们将介绍constraints都是hard constrints的情况。\

Example

我以以下的例子为例,来讲解constrained optimization

maximize subject to f(x,y)=x2yx2+y2=1

分别画出这两个分布的图如下, 约束是一个圆,为了方便起见我们将圆投影到了目标函数上去了。
这里写图片描述
以图形上来看,我们并不能太看出这个问题怎么来解。我们并不能在圆上选取一个初始值,然后迭代去找最值,因为这样非常容易就到了局部最优了。\
这里介绍一种新的思路,将目标函数的等值线求出来,研究等值线的变化。如下图所示是目标函数的等值线。
这里写图片描述
等值线应该就是梯度的垂直方向(值不变)。等值线与往外,其与圆上交点,在目标数中的值就越大。那么最大的就是切线了。不仅是这个例子中,我们可以得出来一个比较通用的结论: 在约束与等值线相切得地方,是求得最值得地方;进一步得出,在目标函数的梯度与约束函数的梯度在同一个方向上时,求得最值。
这里写图片描述
通过如上分析,我们可以得出如下等式
[2xy,x2]x2+y2=λ[2x,2y]=1

以上有三个方程,刚好可以解三个不等式,解出来x,y分别有两组解,根据组合,一共可以得到4组可能的解,将四组解带入到目标函数中,就可以获得相应的值,就能解决这个问题了。

Insight lagrangian multiplier

在上一节的介绍中,我们可以看到约束的梯度与目标的提取是一个线性关系,这个拉格朗日乘子的性质在这一节中进行介绍。\
这里介绍lagrangian 乘子法。

f(x,y)g(x,y)L(x,y,λ)=x2y=x2+y2=b=1=f(x,y)λ(g(x,y)b)

然后求 L(x,y,λ) 的最值,依次让其每一个偏导数等于0. 说到底,得到的就是三个方程,解三个变量,与前面的本质上是一样的,这里其实说的是一种compact的表达方式。\

the λ

在解 L 的过程中,我们可以得到xop,yop,λop. 这里 λop 并不是一个很笨的数值(不包含任何信息)。实际上 λop 是包含了如下信息的: how much we can increase the revenue(f), if we increase the budget (b). 有如下结论

Mopλop=f(xop,yop)=f(x(b),y(b))=Mopb

这里尚未证明,但是结论非常有意思,这表示的是如果我增加b(在金融中是budget),那么带来的最大收益会增加多少(那这个值在决策中就非常有用了。 λ 只要lamda大于1)\

proof of the conclusion

证明比较简单,为了简单起见使用*表示最优值

L(x,y,λ)L(x(b),y(b),λ(b))Lbλ=f(x,y)λ(g(x,y)b)=f(x,y)=M=f(x(b),y(b))λ(b)(g(x(b),y(b))b)=Lxxb+Lyyb+Lλλb+Lbbb=Mb

这里也就是上一节中给出来的结论了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
最新PSO,最优化,粒子群最优化算法。Previously titled "Another Particle Swarm Toolbox" Introduction Particle swarm optimization (PSO) is a derivative-free global optimum solver. It is inspired by the surprisingly organized behaviour of large groups of simple animals, such as flocks of birds, schools of fish, or swarms of locusts. The individual creatures, or "particles", in this algorithm are primitive, knowing only four simple things: 1 & 2) their own current location in the search space and fitness value, 3) their previous personal best location, and 4) the overall best location found by all the particles in the "swarm". There are no gradients or Hessians to calculate. Each particle continually adjusts its speed and trajectory in the search space based on this information, moving closer towards the global optimum with each iteration. As seen in nature, this computational swarm displays a remarkable level of coherence and coordination despite the simplicity of its individual particles. Ease of Use If you are already using the Genetic Algorithm (GA) included with MATLAB's Global Optimization Toolbox, then this PSO toolbox will save you a great deal of time. It can be called from the MATLAB command line using the same syntax as the GA, with some additional options specific to PSO. This will allow a high degree of code re-usability between the PSO toolbox and the GA toolbox. Certain GA-specific parameters such as cross-over and mutation functions will obviously not be applicable to the PSO algorithm. However, many of the commonly used options for the Genetic Algorithm Toolbox may be used interchangeably with PSO since they are both iterative population-based solvers. See >> help pso (from the ./psopt directory) for more details.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值