欢迎来到天天文库
浏览记录
ID:49847002
大小:68.50 KB
页数:2页
时间:2020-03-04
《wolf-powell算法搜索步长.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、%利用wolf-powell线性搜索步长functionalpha1=wolfpowell(f,x,x0,d)g=jacobian(f,x);%求函数f的梯度sigma1=0.25;%给定常数1sigma2=0.7;%给定常数2beta1=5;%步长初始值theta1=0.5;%步长变化比例1theta2=0.7;%步长变化比例2%求步长alpha1ifsubs(f,x,x0+d)<=subs(f,x,x0)+sigma1*subs(g,x,x0)*d'&&subs(g,x,x0+d)*d'>=sigma2*subs(g,x,x0)*d'alpha
2、1=1;%满足第一个条件的最大步长elsealpha1=beta1;whilesubs(f,x,x0+alpha1*d)>subs(f,x,x0)+sigma1*alpha1*subs(g,x,x0)*d'alpha1=theta1*alpha1;endwhilesubs(f,x,x0+alpha1/theta1*d)<=subs(f,x,x0)+sigma1*alpha1/theta1*subs(g,x,x0)*d'alpha1=alpha1/theta1;endend%使步长满足第二个条件whilesubs(g,x,x0+alpha1*d)*d
3、'subs(f,x,x0)+sigma1*alpha2*subs(g,x,x0)*d'i=i+1;alpha2=alpha1+theta2^i*(beta2-alpha1);endalpha1=alpha2;end
此文档下载收益归作者所有