亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pso_trelea_vectorized.m

?? particle swarm optimization toolbox for matlab.粒子群優化的工具箱
?? M
?? 第 1 頁 / 共 2 頁
字號:
% pso_Trelea_vectorized.m% a generic particle swarm optimizer% to find the minimum or maximum of any % MISO matlab function%% Implements Common, Trelea type 1 and 2, and Clerc's class 1". It will% also automatically try to track to a changing environment (with varied% success - BKB 3/18/05)%% This vectorized version removes the for loop associated with particle% number. It also *requires* that the cost function have a single input% that represents all dimensions of search (i.e., for a function that has 2% inputs then make a wrapper that passes a matrix of ps x 2 as a single% variable)%% Usage:%  [optOUT]=PSO(functname,D)% or:%  [optOUT,tr,te]=...%        PSO(functname,D,mv,VarRange,minmax,PSOparams,plotfcn,PSOseedValue)%% Inputs:%    functname - string of matlab function to optimize%    D - # of inputs to the function (dimension of problem)%    % Optional Inputs:%    mv - max particle velocity, either a scalar or a vector of length D%           (this allows each component to have it's own max velocity), %           default = 4, set if not input or input as NaN%%    VarRange - matrix of ranges for each input variable, %      default -100 to 100, of form:%       [ min1 max1 %         min2 max2%            ...%         minD maxD ]%%    minmax = 0, funct minimized (default)%           = 1, funct maximized%           = 2, funct is targeted to P(12) (minimizes distance to errgoal)%%    PSOparams - PSO parameters%      P(1) - Epochs between updating display, default = 100. if 0, %             no display%      P(2) - Maximum number of iterations (epochs) to train, default = 2000.%      P(3) - population size, default = 24%%      P(4) - acceleration const 1 (local best influence), default = 2%      P(5) - acceleration const 2 (global best influence), default = 2%      P(6) - Initial inertia weight, default = 0.9%      P(7) - Final inertia weight, default = 0.4%      P(8) - Epoch when inertial weight at final value, default = 1500%      P(9)- minimum global error gradient, %                 if abs(Gbest(i+1)-Gbest(i)) < gradient over %                 certain length of epochs, terminate run, default = 1e-25%      P(10)- epochs before error gradient criterion terminates run, %                 default = 150, if the SSE does not change over 250 epochs%                               then exit%      P(11)- error goal, if NaN then unconstrained min or max, default=NaN%      P(12)- type flag (which kind of PSO to use)%                 0 = Common PSO w/intertia (default)%                 1,2 = Trelea types 1,2%                 3   = Clerc's Constricted PSO, Type 1"%      P(13)- PSOseed, default=0%               = 0 for initial positions all random%               = 1 for initial particles as user input%%    plotfcn - optional name of plotting function, default 'goplotpso',%              make your own and put here%%    PSOseedValue - initial particle position, depends on P(13), must be%                   set if P(13) is 1 or 2, not used for P(13)=0, needs to%                   be nXm where n<=ps, and m<=D%                   If n<ps and/or m<D then remaining values are set random%                   on Varrange% Outputs:%    optOUT - optimal inputs and associated min/max output of function, of form:%        [ bestin1%          bestin2%            ...%          bestinD%          bestOUT ]%% Optional Outputs:%    tr    - Gbest at every iteration, traces flight of swarm%    te    - epochs to train, returned as a vector 1:endepoch%% Example:  out=pso_Trelea_vectorized('f6',2)% Brian Birge% Rev 3.3% 2/18/06function [OUT,varargout]=pso_Trelea_vectorized(functname,D,varargin)rand('state',sum(100*clock));if nargin < 2   error('Not enough arguments.');end% PSO PARAMETERSif nargin == 2      % only specified functname and D   VRmin=ones(D,1)*-100;    VRmax=ones(D,1)*100;       VR=[VRmin,VRmax];   minmax = 0;   P = [];   mv = 4;   plotfcn='goplotpso';   elseif nargin == 3  % specified functname, D, and mv   VRmin=ones(D,1)*-100;    VRmax=ones(D,1)*100;       VR=[VRmin,VRmax];   minmax = 0;   mv=varargin{1};   if isnan(mv)       mv=4;   end   P = [];   plotfcn='goplotpso';   elseif nargin == 4  % specified functname, D, mv, Varrange   mv=varargin{1};   if isnan(mv)       mv=4;   end   VR=varargin{2};    minmax = 0;   P = [];   plotfcn='goplotpso';   elseif nargin == 5  % Functname, D, mv, Varrange, and minmax   mv=varargin{1};   if isnan(mv)       mv=4;   end       VR=varargin{2};   minmax=varargin{3};   P = [];   plotfcn='goplotpso';elseif nargin == 6  % Functname, D, mv, Varrange, minmax, and psoparams   mv=varargin{1};   if isnan(mv)       mv=4;   end       VR=varargin{2};   minmax=varargin{3};   P = varargin{4}; % psoparams   plotfcn='goplotpso';   elseif nargin == 7  % Functname, D, mv, Varrange, minmax, and psoparams, plotfcn   mv=varargin{1};   if isnan(mv)       mv=4;   end       VR=varargin{2};   minmax=varargin{3};   P = varargin{4}; % psoparams   plotfcn = varargin{5}; elseif nargin == 8  % Functname, D, mv, Varrange, minmax, and psoparams, plotfcn, PSOseedValue   mv=varargin{1};   if isnan(mv)       mv=4;   end       VR=varargin{2};   minmax=varargin{3};   P = varargin{4}; % psoparams   plotfcn = varargin{5};     PSOseedValue = varargin{6};else       error('Wrong # of input arguments.');end% sets up default pso paramsPdef = [100 2000 24 2 2 0.9 0.4 1500 1e-25 250 NaN 0 0];Plen = length(P);P    = [P,Pdef(Plen+1:end)];df      = P(1);me      = P(2);ps      = P(3);ac1     = P(4);ac2     = P(5);iw1     = P(6);iw2     = P(7);iwe     = P(8);ergrd   = P(9);ergrdep = P(10);errgoal = P(11);trelea  = P(12);PSOseed = P(13);% used with trainpso, for neural net trainingif strcmp(functname,'pso_neteval')   net = evalin('caller','net');    Pd = evalin('caller','Pd');    Tl = evalin('caller','Tl');    Ai = evalin('caller','Ai');     Q = evalin('caller','Q');    TS = evalin('caller','TS');end% error checking if ((minmax==2) & isnan(errgoal))     error('minmax= 2, errgoal= NaN: choose an error goal or set minmax to 0 or 1'); end if ( (PSOseed==1) & ~exist('PSOseedValue') )     error('PSOseed flag set but no PSOseedValue was input'); end if exist('PSOseedValue')     tmpsz=size(PSOseedValue);     if D < tmpsz(2)         error('PSOseedValue column size must be D or less');     end     if ps < tmpsz(1)         error('PSOseedValue row length must be # of particles or less');     end end % set plotting flagif (P(1))~=0  plotflg=1;else  plotflg=0;end% preallocate variables for speed up tr = ones(1,me)*NaN;% take care of setting max velocity and position params hereif length(mv)==1 velmaskmin = -mv*ones(ps,D);     % min vel, psXD matrix velmaskmax = mv*ones(ps,D);      % max velelseif length(mv)==D      velmaskmin = repmat(forcerow(-mv),ps,1); % min vel velmaskmax = repmat(forcerow( mv),ps,1); % max velelse error('Max vel must be either a scalar or same length as prob dimension D');endposmaskmin  = repmat(VR(1:D,1)',ps,1);  % min pos, psXD matrixposmaskmax  = repmat(VR(1:D,2)',ps,1);  % max posposmaskmeth = 3; % 3=bounce method (see comments below inside epoch loop)% PLOTTING message = sprintf('PSO: %%g/%g iterations, GBest = %%20.20g.\n',me); % INITIALIZE INITIALIZE INITIALIZE INITIALIZE INITIALIZE INITIALIZE % initialize population of particles and their velocities at time zero,% format of pos= (particle#, dimension) % construct random population positions bounded by VR  pos(1:ps,1:D) = normmat(rand([ps,D]),VR',1);    if PSOseed == 1         % initial positions user input, see comments above    tmpsz                      = size(PSOseedValue);    pos(1:tmpsz(1),1:tmpsz(2)) = PSOseedValue;    end % construct initial random velocities between -mv,mv  vel(1:ps,1:D) = normmat(rand([ps,D]),...      [forcecol(-mv),forcecol(mv)]',1);% initial pbest positions vals pbest = pos;% VECTORIZE THIS, or at least vectorize cost funct call  out = feval(functname,pos);  % returns column of cost values (1 for each particle)%---------------------------  pbestval=out;   % initially, pbest is same as pos% assign initial gbest here also (gbest and gbestval) if minmax==1   % this picks gbestval when we want to maximize the function    [gbestval,idx1] = max(pbestval); elseif minmax==0   % this works for straight minimization    [gbestval,idx1] = min(pbestval); elseif minmax==2   % this works when you know target but not direction you need to go   % good for a cost function that returns distance to target that can be either   % negative or positive (direction info)    [temp,idx1] = min((pbestval-ones(size(pbestval))*errgoal).^2);    gbestval    = pbestval(idx1); end % preallocate a variable to keep track of gbest for all iters bestpos        = zeros(me,D+1)*NaN; gbest          = pbest(idx1,:);  % this is gbest position   % used with trainpso, for neural net training   % assign gbest to net at each iteration, these interim assignments   % are for plotting mostly    if strcmp(functname,'pso_neteval')        net=setx(net,gbest);    end %tr(1)          = gbestval;       % save for output bestpos(1,1:D) = gbest; % this part used for implementing Carlisle and Dozier's APSO idea% slightly modified, this tracks the global best as the sentry whereas% their's chooses a different point to act as sentry% see "Tracking Changing Extremea with Adaptive Particle Swarm Optimizer",% part of the WAC 2002 Proceedings, June 9-13, http://wacong.com sentryval = gbestval; sentry    = gbest; if (trelea == 3)% calculate Clerc's constriction coefficient chi to use in his form kappa   = 1; % standard val = 1, change for more or less constriction     if ( (ac1+ac2) <=4 )     chi = kappa; else

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
粉嫩av一区二区三区粉嫩| 国产无遮挡一区二区三区毛片日本| 日本丶国产丶欧美色综合| 91精品国产91久久综合桃花| 国产日韩一级二级三级| 偷拍亚洲欧洲综合| 成人一级片在线观看| 欧美一区二区三区小说| 亚洲在线视频网站| 成人一区二区视频| 亚洲精品在线电影| 香蕉加勒比综合久久| 99这里只有精品| 久久影院视频免费| 美女视频免费一区| 欧美日高清视频| 亚洲激情图片一区| 99视频精品全部免费在线| 国产亚洲一区二区在线观看| 日韩中文字幕1| 欧美三级电影在线看| 中文字幕一区日韩精品欧美| 国产激情一区二区三区四区| 日韩一级视频免费观看在线| 天使萌一区二区三区免费观看| 在线这里只有精品| 亚洲欧美日韩国产综合| 99精品一区二区| 国产精品乱码一区二三区小蝌蚪| 国产一区二区电影| 26uuu国产电影一区二区| 精品在线亚洲视频| 26uuu欧美| 国产一区二区在线影院| 亚洲自拍另类综合| 波多野结衣视频一区| 中文字幕一区二区三区乱码在线| 成人黄色综合网站| 成人欧美一区二区三区1314| 国产很黄免费观看久久| 国产精品人人做人人爽人人添| 国产成人小视频| 欧美国产一区在线| 99久久精品国产毛片| 亚洲精品五月天| 欧美日韩一级二级| 首页国产欧美日韩丝袜| 精品福利在线导航| 国产a久久麻豆| 亚洲精选视频在线| 欧美精品日韩一本| 黑人巨大精品欧美黑白配亚洲| 欧美电影免费观看高清完整版在线| 老司机精品视频导航| 久久影院午夜片一区| 99热国产精品| 亚洲图片欧美色图| 日韩精品一区二区三区老鸭窝| 国产美女视频91| 国产精品沙发午睡系列990531| 不卡一卡二卡三乱码免费网站| 亚洲欧美另类小说视频| 制服丝袜一区二区三区| 国产一区不卡在线| 一区二区三区欧美亚洲| 日韩视频在线观看一区二区| 国产999精品久久| 亚洲国产精品精华液网站| 日韩视频免费观看高清完整版在线观看| 国产一区二区福利视频| 一区二区三区中文在线| 日韩一二三区不卡| 色综合咪咪久久| 肉色丝袜一区二区| 日韩国产在线观看| 国产免费观看久久| 欧美一区二区视频观看视频| 成人午夜短视频| 日韩成人午夜电影| 亚洲欧洲av一区二区三区久久| 欧美精品在线观看播放| www.综合网.com| 久久精品久久久精品美女| 亚洲区小说区图片区qvod| 精品久久久三级丝袜| 欧美丝袜自拍制服另类| 国产a视频精品免费观看| 五月婷婷久久综合| 亚洲精品日韩一| 欧美国产乱子伦| 精品国产91乱码一区二区三区 | 欧美日韩精品三区| 成人免费视频视频| 激情综合网最新| 日韩激情视频网站| 亚洲自拍偷拍九九九| 亚洲欧洲日韩一区二区三区| 2021中文字幕一区亚洲| 91麻豆精品国产91| 欧美日韩三级一区二区| 91香蕉国产在线观看软件| 国产v综合v亚洲欧| 韩国欧美国产1区| 日本不卡免费在线视频| 亚洲成人在线网站| 亚洲电影视频在线| 亚洲欧美另类久久久精品| 国产精品区一区二区三区| 国产日韩高清在线| 久久久久久影视| 久久这里只精品最新地址| 欧美精品一区二区三区高清aⅴ | 亚洲特级片在线| 国产三级一区二区| 国产欧美日韩中文久久| 国产日韩精品一区二区浪潮av| 亚洲成人先锋电影| 亚洲精品乱码久久久久久久久| 亚洲婷婷在线视频| 亚洲综合偷拍欧美一区色| 一区二区三区四区乱视频| 亚洲乱码国产乱码精品精小说| 中文字幕视频一区| 亚洲欧美另类图片小说| 亚洲风情在线资源站| 五月激情综合色| 麻豆极品一区二区三区| 韩国精品免费视频| 成人免费观看av| 色综合色狠狠天天综合色| 欧美中文字幕一区二区三区亚洲 | 欧美日韩精品一区二区三区四区| 91福利社在线观看| 欧美精品 国产精品| 欧美一区二区三区免费观看视频| 日韩三级高清在线| 国产日产亚洲精品系列| 日韩理论片一区二区| 午夜在线电影亚洲一区| 久久99精品久久久久| 成人av综合一区| 在线观看国产一区二区| 日韩视频不卡中文| 国产精品久久二区二区| 亚洲国产一区视频| 久久精品国产色蜜蜜麻豆| 成人av一区二区三区| 欧美三级韩国三级日本一级| 欧美成人一区二区三区在线观看 | 成人美女视频在线观看18| 色综合久久88色综合天天免费| 欧美另类videos死尸| 欧美激情一区三区| 午夜精品久久久久久久久久久 | 日韩毛片精品高清免费| 一区二区三区中文字幕精品精品| 奇米影视一区二区三区| 成人国产精品免费观看动漫| 欧美日韩精品高清| 国产精品丝袜黑色高跟| 视频一区在线播放| 99久久久精品免费观看国产蜜| 在线成人av影院| 《视频一区视频二区| 狠狠色丁香久久婷婷综合_中| 99久久精品国产导航| 精品久久久久久久久久久久久久久 | 国产精品成人免费在线| 日韩电影在线看| 99久久综合99久久综合网站| 日韩欧美另类在线| 一区二区三区免费网站| 国产成人av福利| 欧美精品一二三四| 亚洲日本青草视频在线怡红院| 精品一区二区三区欧美| 欧美日韩激情一区二区| 国产精品久久久久久久岛一牛影视| 美女www一区二区| 色狠狠综合天天综合综合| 欧美国产一区二区在线观看| 99精品视频一区二区三区| 日韩午夜激情免费电影| 午夜久久久影院| 91美女片黄在线| 国产精品国产三级国产| 国产一区二区不卡| 欧美xxxxx裸体时装秀| 日韩中文字幕91| 欧美日韩综合色| 夜夜爽夜夜爽精品视频| 一本久道久久综合中文字幕| 国产精品欧美一区喷水| 国产成人免费在线| 欧美二区乱c少妇| 亚洲人成伊人成综合网小说| 国产成人精品午夜视频免费 | 精品一区二区久久| 日韩视频在线你懂得| 奇米影视在线99精品|