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

📄 pso_neteval.m

📁 本文是关于粒子群算法(pso)的介绍和相关MATLAB源程序,是智能天线权值优化方面的一种很前沿的算法
💻 M
字号:
% pso_neteval.m
% function to evaluate a neural nets performance as called from
% the PSO function: pso_Trelea_vectorized.m and trainpso.m
%
%  usage: cost = pso_neteval(x)
%   where x is an MxN array of weights & biases
%       M is particle index
%       N is weight & bias index

% Brian Birge
% Rev 2.0
% 3/8/06

function cost = pso_neteval(x)
  for i=1:length(x(:,1)) % # of particles passed, because of simfuncname we can't vectorize
    net = evalin('caller','net');

    Pd = evalin('caller','Pd');
    Tl = evalin('caller','Tl');
    Ai = evalin('caller','Ai');
    Q  = evalin('caller','Q');
    TS = evalin('caller','TS');
    
    X   = x(i,:)';    
    net = setx(net,X); % setx is mega-slow

    [perf,El,Ac,N,Zb,Zi,Zl] = calcperf(net,X,Pd,Tl,Ai,Q,TS);

    cost(i,1) = perf;
  end
  
return

⌨️ 快捷键说明

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