⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 igls.m

📁 类神经网路─MATLAB的应用(范例程式)
💻 M
字号:
function [W1,W2,lambda,GAMMA]=igls(NetDef,W1,W2,trparms,repeat,GAMMA,PHI,Y);
%  IGLS
%  ----
%          Train a multi-output network and estimate the covariance matrix
%          simultaneously using the IGLS-procedure (iterated Generalized
%          Least Squares). The network is trained with a Levenberg-Marquardt
%          method. So far, the function is restriced to work for NNARX and
%          NNSSIF models.
%
%  CALL:
%       [W1,W2,lambda,Gamma]=igls(NetDef,W1,W2,trparms,repeat,Gamma,PHI,Y);
%
%  INPUTS: 
%    NN,W1,W2,PHI,Y : See MARQ
%    trparms : Contains parameters associated with the training (see MARQ)
%              If trparms=[] it is reset to trparms = [50 0 1 0]
%    repeat  : Number of times the procedure should be repeated
%              If repeat=[] it is set to repeat=5
%    GAMMA   : Covariance matrix. If passed as [] it is initialized to 
%              the identity matrix.
%
%  OUTPUTS:
%    W1, W2, lambda: See MARQ
%    GAMMA         : Estimated covariance matrix
%                                                                                  
%  Programmed by : Magnus Norgaard, IAU/IMM Technical University of Denmark
%  LastEditDate  : June 15, 1997

[ny,N] = size(Y);
if isempty(GAMMA), GAMMA=eye(ny); end
if isempty(repeat), repeat = 5; end 
GAMMAi = inv(GAMMA);
for iglsiter=1:repeat,
  S = sqrtm(GAMMAi);
  YS= S*Y;
  [W1,W2,PIvec,iteration,lambda]=marq(NetDef,W1,W2,PHI,YS,trparms);
  [Yhat,E] = nneval(NetDef,W1,W2,PHI,YS,1);
  E=(GAMMA*S')*E;
  GAMMA = (E*E')/N;
  GAMMAi= inv(GAMMA);
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -