日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 人工智能 > 循环神经网络 >内容正文

循环神经网络

鲍威尔法源程序码matlab,鲍威尔算法matlab程序.doc

發(fā)布時(shí)間:2024/8/1 循环神经网络 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 鲍威尔法源程序码matlab,鲍威尔算法matlab程序.doc 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

function f=fun(x)

f=10*(x(1)+x(2)-5)^2+(x(1)-x(2))^2;

function f=fx(x0,alpha,s)

x1=x0+alpha*s;

f=fun(x1);

function f=fsearch(x0,s)

%利用進(jìn)退法確定高低高區(qū)間

alpha1=0;

h=0.1;

alpha2=alpha1+h;

f1=fx(x0,alpha1,s);

f2=fx(x0,alpha2,s);

if f1>f2

alpha3=alpha2+h;

f3=fx(x0,alpha3,s);

while f2>f3

alpha1=alpha2;

alpha2=alpha3;

alpha3=alpha3+h;

f2=f3;

f3=fx(x0,alpha3,s);

end

else

h=-h;

v=alpha1;

alpha1=alpha2;

alpha2=v;

v=f1;

f1=f2;

f2=v;

alpha3=alpha2+h;

f3=fx(x0,alpha3,s);

while f2>f3

alpha1=alpha2;

alpha2=alpha3;

alpha3=alpha3+h;

f2=f3;

f3=fx(x0,alpha3,s);

end

end

a=min(alpha1,alpha3);

b=max(alpha1,alpha3);

%利用黃金分割點(diǎn)法求解

alpha1=a+0.382*(b-a);

alpha2=a+0.618*(b-a);

f1=fx(x0,alpha1,s);

f2=fx(x0,alpha2,s);

while abs(a-b)>0.001

if f1>f2

a=alpha1;

alpha1=alpha2;

f1=f2;

alpha2=a+0.618*(b-a);

f2=fx(x0,alpha2,s);

else

b=alpha2;

alpha2=alpha1;

f2=f1;

alpha1=a+0.382*(b-a);

f1=fx(x0,alpha1,s);

end

end

f=0.5*(a+b);

clear

%初始點(diǎn)

x0=[0;0];

%搜索方向

e1=[1;0];

e2=[0;1];

G0=fun(x0);

F0=G0;

%第一次迭代

%沿著e1

alpha1=fsearch(x0,e1);

x1=x0+alpha1*e1;

F1=fun(x1);

delta1=F0-F1;

% 沿著方向e2;

alpha2=fsearch(x1,e2);

x2=x1+alpha2*e2;

F2=fun(x2);

G2=F2;

delta2=F1-F2;

deltam=max(delta1,delta2);

%映射點(diǎn)

x3=2*x2-x0;

G3=fun(x3);

if G3

^2

s=x2-x0;

%方向替換

e1=e2;

e2=s;

% 沿著方向s 進(jìn)行搜索

alpha3=fsearch(x2,s);

x3=x2+alpha2*s;

x0=x3;

else

if F2>G3

x0=x3;

else

x0=x2;

end

End

子文件JT,JH

進(jìn)退法程序代碼?56555 .

function [minx,maxx] = minJT(f,x0,h0,eps)

format long;

if nargin == 3

eps = 1.0e-6;

end

x1 = x0;

k = 0;

h = h0;

while 1

x4 = x1 + h;

k = k+1;

f4 = subs(f, findsym(f),x4);

f1 = subs(f, findsym(f),x1);

if f4 < f1

x2 = x1;

x1 = x4;

f2 = f1;

f1 = f4;

h = 2*h;

else

if k==1

h = -h;

x2 = x4;

f2 = f4;

else

x3 = x2;

x2 = x1;

x1 = x4;

break;

end

end

end

minx = min(x1,x3);

maxx = x1+x3 - minx;

format short;

黃金分割法程序代碼?56555 .

function [x,minf] = minHJ(f,a,b,eps)

format long;

if nargin == 3

eps = 1.0e-6;

end

l = a + 0.382*(b-a);

u = a + 0.618*(b-a);

k=1;

tol = b-a;

while tol>eps && k<100000

fl = subs(f , findsym

總結(jié)

以上是生活随笔為你收集整理的鲍威尔法源程序码matlab,鲍威尔算法matlab程序.doc的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。