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

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

?? pso_trelea_vectorized.m

?? 此為微粒群優化算法PSO工具箱
?? 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一区一区三区| 性欧美大战久久久久久久久| 欧美一级免费观看| 国产精品一区不卡| 亚洲欧美激情视频在线观看一区二区三区| 99视频一区二区三区| 亚洲香肠在线观看| 久久理论电影网| 在线观看日韩av先锋影音电影院| 日韩国产精品久久久久久亚洲| 久久久久久黄色| 一本色道久久综合亚洲精品按摩| 婷婷国产v国产偷v亚洲高清| 亚洲精品一区二区三区香蕉| 99国产精品久久久| 麻豆精品国产传媒mv男同| 欧美国产日韩a欧美在线观看 | 91精品综合久久久久久| 精品中文字幕一区二区| 国产精品成人免费精品自在线观看 | 亚洲人成电影网站色mp4| 91麻豆精品国产91久久久久| 国产大陆亚洲精品国产| 亚洲一区二区三区激情| 26uuu精品一区二区在线观看| 91在线码无精品| 美女国产一区二区三区| 亚洲视频资源在线| 久久久久久免费网| 欧美日韩一区三区| 成人一道本在线| 美国欧美日韩国产在线播放| 亚洲欧美精品午睡沙发| 国产日韩影视精品| 日韩一级完整毛片| 在线看日本不卡| 成人精品视频网站| 久久精品72免费观看| 亚洲一二三四区| 日本一区二区免费在线| 欧美成人aa大片| 欧美片网站yy| 色狠狠综合天天综合综合| 国产99一区视频免费| 男男gaygay亚洲| 一区二区三区欧美激情| 国产精品天天看| 精品国产麻豆免费人成网站| 欧美日产国产精品| 在线观看视频欧美| 色综合激情久久| 国产成人aaa| 国产精品自在在线| 日韩av网站在线观看| 亚瑟在线精品视频| 亚洲电影你懂得| 亚洲自拍偷拍网站| 一区二区三区蜜桃网| 亚洲天天做日日做天天谢日日欢| 久久综合色天天久久综合图片| 日韩一区二区三区电影| 日韩一区二区三区精品视频| 欧美一区午夜视频在线观看| 欧美日韩久久一区二区| 欧美亚洲精品一区| 欧美日韩一级二级| 7777精品伊人久久久大香线蕉的 | 久久久国产午夜精品| 精品入口麻豆88视频| 欧美mv日韩mv国产网站| 欧美成人女星排名| 欧美精品一区二区三区视频| 欧美videossexotv100| 精品国产一区二区精华| 日韩精品一区在线| 2023国产精品| 亚洲国产精品t66y| 亚洲天堂av一区| 亚洲欧美国产高清| 亚洲一区日韩精品中文字幕| 亚洲成人福利片| 日本不卡的三区四区五区| 麻豆91精品视频| 国产一区二区伦理| 99久久精品费精品国产一区二区| 91九色02白丝porn| 欧美一区二区性放荡片| 精品福利一区二区三区免费视频| 久久久久高清精品| 亚洲欧美国产毛片在线| 天天综合色天天综合| 美女爽到高潮91| 成人久久视频在线观看| 91极品视觉盛宴| 日韩一区二区三区免费看 | 一本大道久久a久久综合婷婷| 欧美视频你懂的| 精品国产乱码久久久久久浪潮| 久久精品视频在线看| 亚洲欧美日韩国产另类专区| 日韩二区三区四区| bt欧美亚洲午夜电影天堂| 精品婷婷伊人一区三区三| 日韩欧美高清dvd碟片| 国产精品视频麻豆| 午夜精品123| 国产精品456露脸| 欧美亚一区二区| 久久网这里都是精品| 亚洲精选一二三| 国产自产视频一区二区三区| 99久久婷婷国产综合精品电影| 日韩一区二区中文字幕| 亚洲欧美电影一区二区| 久久超碰97中文字幕| 日本韩国一区二区三区| 精品福利一区二区三区免费视频| 亚洲精品你懂的| 国产成人av福利| 日韩欧美国产精品| 一区二区三区成人在线视频| 国产精品一区专区| 欧美三级视频在线| 中文字幕乱码久久午夜不卡| 日本v片在线高清不卡在线观看| 成人av电影在线播放| 精品国产凹凸成av人导航| 五月激情综合网| 一本大道av伊人久久综合| 欧美国产禁国产网站cc| 麻豆精品国产传媒mv男同| 欧美日韩在线播放一区| 自拍av一区二区三区| 高清日韩电视剧大全免费| 日韩一级精品视频在线观看| 亚洲国产视频直播| 91猫先生在线| 国产精品久久久久一区二区三区共| 精品伊人久久久久7777人| 欧美久久一二区| 亚洲午夜在线电影| 色一区在线观看| 最新中文字幕一区二区三区| 国产91精品一区二区麻豆网站| 欧美一区二区三区四区视频| 午夜视频在线观看一区二区三区| 91丨国产丨九色丨pron| 中文文精品字幕一区二区| 国产精品影视在线观看| 久久免费偷拍视频| 国产精品一区在线观看你懂的| 精品动漫一区二区三区在线观看 | 激情综合网天天干| 日韩三级视频中文字幕| 男女性色大片免费观看一区二区| 欧美性做爰猛烈叫床潮| 亚洲成人综合在线| 欧美日韩激情一区二区| 丝袜a∨在线一区二区三区不卡| 欧美日韩一区二区三区在线看| 一区av在线播放| 欧美日韩视频第一区| 日韩精品一区第一页| 欧美一级黄色录像| 国产在线不卡一卡二卡三卡四卡| 久久理论电影网| 国产成人8x视频一区二区 | 亚洲永久精品大片| 欧美日韩一区二区欧美激情| 日本成人在线看| 2024国产精品| 懂色一区二区三区免费观看| 国产精品美女一区二区在线观看| gogo大胆日本视频一区| 亚洲国产精品自拍| 欧美一区二区黄色| 国产九色sp调教91| 亚洲婷婷综合色高清在线| 欧美嫩在线观看| 韩日av一区二区| 国产精品短视频| 欧美日韩亚洲综合一区| 日本三级亚洲精品| 欧美国产日本视频| 欧美色视频在线观看| 免费看日韩a级影片| 久久久久99精品一区| 一本色道久久综合亚洲精品按摩| 天天av天天翘天天综合网| 亚洲精品在线电影| 色8久久人人97超碰香蕉987| 青娱乐精品视频在线| 亚洲欧洲日韩女同|