自适应模糊神经网络MATLAB代码Word下载.docx

上传人:b****3 文档编号:15413062 上传时间:2022-10-30 格式:DOCX 页数:5 大小:14.98KB
下载 相关 举报
自适应模糊神经网络MATLAB代码Word下载.docx_第1页
第1页 / 共5页
自适应模糊神经网络MATLAB代码Word下载.docx_第2页
第2页 / 共5页
自适应模糊神经网络MATLAB代码Word下载.docx_第3页
第3页 / 共5页
自适应模糊神经网络MATLAB代码Word下载.docx_第4页
第4页 / 共5页
自适应模糊神经网络MATLAB代码Word下载.docx_第5页
第5页 / 共5页
亲,该文档总共5页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

自适应模糊神经网络MATLAB代码Word下载.docx

《自适应模糊神经网络MATLAB代码Word下载.docx》由会员分享,可在线阅读,更多相关《自适应模糊神经网络MATLAB代码Word下载.docx(5页珍藏版)》请在冰豆网上搜索。

自适应模糊神经网络MATLAB代码Word下载.docx

k_sigma=1.12;

%Formoreaccurateresultsuncommentthefollowing

%formatlong;

%ImplementationofaSOFNNmodel

[size_R,size_N]=size(X);

%size_R-thenumberofinputvariables

c=[];

 

sigma=[];

W_output=[];

u=0;

%thenumberofneuronsinthestructure

Q=[];

O=[];

Psi=[];

forn=1:

size_N

 

x=X(:

n);

ifu==0%Noneuroninthestructure?

c=x;

sigma=SigmaZero*ones(size_R,1);

u=1;

Psi=GetMePsi(X,c,sigma);

[Q,O]=UpdateStructure(X,Psi,d);

pT_n=GetMeGreatPsi(x,Psi(n,:

))'

;

else

[Q,O,pT_n]=UpdateStructureRecursively(X,Psi,Q,O,d,n);

end;

KeepSpinning=true;

whileKeepSpinning

%Calculatetheerrorandif-partcriteria

ae=abs(d(n)-pT_n*O);

%approximationerror

[phi,~]=GetMePhi(x,c,sigma);

[maxphi,maxindex]=max(phi);

%maxindexreferstotheneuron'

sindex

ifae>

delta

ifmaxphi<

threshold

%enlargewidth

[minsigma,minindex]=min(sigma(:

maxindex));

sigma(minindex,maxindex)=k_sigma*minsigma;

Psi=GetMePsi(X,c,sigma);

[Q,O]=UpdateStructure(X,Psi,d);

pT_n=GetMeGreatPsi(x,Psi(n,:

else

%Addanewneuronandupdatestructure

ctemp=[];

sigmatemp=[];

dist=0;

forr=1:

size_R

dist=abs(x(r)-c(r,1));

distIndex=1;

forj=2:

u

ifabs(x(r)-c(r,j))<

dist

distIndex=j;

dist=abs(x(r)-c(r,j));

end;

ifdist<

=Kd(r)

ctemp=[ctemp;

c(r,distIndex)];

sigmatemp=[sigmatemp;

sigma(r,distIndex)];

x(r)];

dist];

c=[cctemp];

sigma=[sigmasigmatemp];

KeepSpinning=false;

u=u+1;

%Donothingandexitthewhile

W_output=O;

end

function[Q_next,O_next,pT_n]=UpdateStructureRecursively(X,Psi,Q,O,d,n)

%O=O(t-1)O_next=O(t)

p_n=GetMeGreatPsi(X(:

n),Psi(n,:

));

pT_n=p_n'

ee=abs(d(n)-pT_n*O);

%|e(t)|

temp=1+pT_n*Q*p_n;

ae=abs(ee/temp);

ifee>

=ae

L=Q*p_n*(temp)^(-1);

Q_next=(eye(length(Q))-L*pT_n)*Q;

O_next=O+L*ee;

Q_next=eye(length(Q))*Q;

O_next=O;

function[Q,O]=UpdateStructure(X,Psi,d)

GreatPsiBig=GetMeGreatPsi(X,Psi);

%M=u*(r+1)

%n-thenumberofobservations

[M,~]=size(GreatPsiBig);

%OthersWaysofgettingQ=[P^T(t)*P(t)]^-1

%**************************************************************************

%opts.SYM=true;

%Q=linsolve(GreatPsiBig*GreatPsiBig'

eye(M),opts);

%

%Q=inv(GreatPsiBig*GreatPsiBig'

);

%Q=pinv(GreatPsiBig*GreatPsiBig'

Y=GreatPsiBig\eye(M);

Q=GreatPsiBig'

\Y;

O=Q*GreatPsiBig*d'

%Thisfunctionworkstoowithx

%(X=XandPsiisaMatrix)-GetsyouthewholeGreatPsi

%(X=xandPsiistherowrelatedtox)-Getsyoujustthecolumnrelatedwiththeobservation

function[GreatPsi]=GetMeGreatPsi(X,Psi)

%Psi-Inarowyougothroughtheneuronsandinacolumnyougothroughnumberof

%observations****Psi(#obs,IndexNeuron)****

GreatPsi=[];

[N,U]=size(Psi);

N

GreatPsiCol=[];

foru=1:

U

GreatPsiCol=[GreatPsiCol;

Psi(n,u)*[1;

x]];

GreatPsi=[GreatPsiGreatPsiCol];

function[phi,SumPhi]=GetM

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > PPT模板 > 艺术创意

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1