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

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

?? neat_main.m

?? 這個是關于neural fuzzy 算法的工具箱, 有例子程序, 請您用winzip解壓縮
?? M
字號:
%%%%%%%%%%%%%%%%%%% Main NEAT file  (calls all other functions) (script file)

%% Neuro_Evolution_of_Augmenting_Topologies - NEAT 
%% developed by Kenneth Stanley (kstanley@cs.utexas.edu) & Risto Miikkulainen (risto@cs.utexas.edu)
%% Coding by Christian Mayr (matlab_neat@web.de)

clear;
tic;
%list of parameters
  
  %parameters of main file
    maxgeneration=200; %maximum number of generations for generational loop    
    load_flag=0; %if set to 1, will load population, generation, innovation_record and species_record from neatsave.mat at start of algorithm, if set to 0, algorithm will start with initial population, new species record and new innovation record, at generation=1 (default option)
    save_flag=1; %if set to 1, will save population, generation, innovation_record and species_record to neatsave.mat at every generation (default option)
    % upshot of this is: the settings above will start with initial population (of your specification) and save all important structures at every generation, so if your workstation crashes or you have to interrupt evolution, you can, at next startup, simply set the load flag to 1 and continue where you have left off. 
    % Please note, however, that only changing structures are saved, the parameters in this section will not be saved, so you have to ensure that you use the same parameters when using a saved version of evolution as when you created this saved version!
    % Also note that all variables are saved in binary matlab format, so file is only readable by matlab. If you want to look at some of the values stored in this file, load it in matlab, then you can access the saved values
    average_number_non_disabled_connections=[];
    average_number_hidden_nodes=[];
    max_overall_fitness=[];
    
  %parameters initial population
    population_size=150;
    number_input_nodes=2;
    number_output_nodes=1;
    vector_connected_input_nodes=[1 2]; %vector of initially connected input nodes out of complete number of input nodes 
                                          %(if you want to start with a subset and let evolution decide which ones are necessary)
                                          %for a fully connected initial population, uncomment the following:
    %vector_connected_input_nodes=1:number_input_nodes;
                                          
                                          
  %speciation parameters  
    % The following structure will contain various information on single species
    % This data will be used for fitness sharing, reproduction, and for visualisation purposes                       
    species_record(1).ID=0;%consecutive species ID's
    species_record(1).number_individuals=0;%number of individuals in species
    species_record(1).generation_record=[]; %matrix will be 4 rows by (number of generations existent) columns, will contain (from top to bottom) number of generation, mean raw fitness, max raw fitness, and index of individual in population which has produced max raw fitness 
    
    speciation.c1=1.0; %Speciation parameters as published by Ken Stanley
    speciation.c2=1.0;
    speciation.c3=0.4;
    speciation.threshold=3;
    
  %reproduction parameters
    %stagnation+refocuse
    stagnation.threshold=1e-2; %threshold to judge if a species is in stagnation (max fitness of species varies below threshold) this threshold is of course dependent on your fitness function, if you have a fitness function which has a large spread, you might want to increase this threshold 
    stagnation.number_generation=15; %if max fitness of species has stayed within stagnation.threshold in the last stagnation.number_generation generations, all its fitnesses will be reduced to 0, so it will die out
                                    %Computation is done the following way: the absolute difference between the average max fitness of the last stagnation.number_generation generations and the max fitness of each of these generations is computed and compared to stagnation.threshold. 
                                    %if it stays within this threshold for the indicated number of generations, the species is eliminated 
    refocus.threshold=1e-2;                                
    refocus.number_generation=20; %if maximum overall fitness of population doesn't change within threhold for this number of generations, only the top two species are allowed to reproduce                                
    
    
    %initial setup
    initial.kill_percentage=0.2; %the percentage of each species which will be eliminated (lowest performing individuals)
    initial.number_for_kill=5; % the above percentage for eliminating individuals will only be used in species which have more individuals than min_number_for_kill 
                               % Please note that whatever the above settings, the code always ensures that at least 2 individuals are kept to be able to cross over, or at least the single individual in a species with only one individual
    initial.number_copy=5; % species which have equal or greater than number_copy individuals will have their best individual copied unchanged into the next generation
    
    %selection (ranking and stochastic universal sampling)
    selection.pressure=2; % Number between 1.1 and 2.0, determines selective pressure towards most fit individual of species
    
    %crossover
    crossover.percentage=0.8; %percentage governs the way in which new population will be composed from old population.  exception: species with just one individual can only use mutation
    crossover.probability_interspecies=0.0 ; %if crossover has been selected, this probability governs the intra/interspecies parent composition being used for the
    crossover.probability_multipoint=0.6; %standard-crossover in which matching connection genes are inherited randomly from both parents. In the (1-crossover.probability_multipoint) cases, weights of the new connection genes are the mean of the corresponding parent genes
    

    
    %mutation
    mutation.probability_add_node=0.03;
    mutation.probability_add_connection=0.05;
    mutation.probability_recurrency=0.0; %if we are in add_connection_mutation, this governs if a recurrent connection is allowed. Note: this will only activate if the random connection is a recurrent one, otherwise the connection is simply accepted. If no possible non-recurrent connections exist for the current node genes, then for e.g. a probability of 0.1, 9 times out of 10 no connection is added. 
    mutation.probability_mutate_weight=0.9;
    mutation.weight_cap=8; % weights will be restricted from -mutation.weight_cap to mutation.weight_cap
    mutation.weight_range=5; % random distribution with width mutation.weight_range, centered on 0. mutation range of 5 will give random distribution from -2.5 to 2.5
    mutation.probability_gene_reenabled=0.25; % Probability of a connection gene being reenabled in offspring if it was inherited disabled 
     
    
%%%%%%%%%%%%%%%%main algorithm%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

if load_flag==0
   
   %call function to create initial population
   %for information about the make-up of the population structure and the innovation_record, look at initial_population.m
   [population,innovation_record]=initial_population(population_size, number_input_nodes, number_output_nodes, vector_connected_input_nodes);

   %initial speciation
   number_connections=(length(vector_connected_input_nodes)+1)*number_output_nodes;
   %put first individual in species one and update species_record
   population(1).species=1;
   matrix_reference_individuals=population(1).connectiongenes(4,:); %species reference matrix (abbreviated, only weights, since there are no topology differences in initial population)
   species_record(1).ID=1;
   species_record(1).number_individuals=1;

   %Loop through rest of individuals and either assign to existing species or create new species and use first individual of new species as reference
   for index_individual=2:size(population,2);
      assigned_existing_species_flag=0;
      new_species_flag=0;
      index_species=1;
      while assigned_existing_species_flag==0 & new_species_flag==0 %loops through the existing species, terminates when either the individual is assigned to existing species or there are no more species to test it against, which means it is a new species 
         distance=speciation.c3*sum(abs(population(index_individual).connectiongenes(4,:)-matrix_reference_individuals(index_species,:)))/number_connections; %computes compatibility distance, abbreviated, only average weight distance considered
         if distance<speciation.threshold %If within threshold, assign to the existing species 
            population(index_individual).species=index_species;
            assigned_existing_species_flag=1;
            species_record(index_species).number_individuals=species_record(index_species).number_individuals+1;
         end
         index_species=index_species+1;
         if index_species>size(matrix_reference_individuals,1) & assigned_existing_species_flag==0 %Outside of species references, must be new species
            new_species_flag=1;
         end
      end
      if new_species_flag==1 %check for new species, if it is, update the species_record and use individual as reference for new species
         population(index_individual).species=index_species;
         matrix_reference_individuals=[matrix_reference_individuals;population(index_individual).connectiongenes(4,:)];
         species_record(index_species).ID=index_species;
         species_record(index_species).number_individuals=1; %if number individuals in a species is zero, that species is extinct
      
      end    
   end
   generation=1;
else % start with saved version of evolution
   load 'neatsave'
end

%%%
%%%
%%%  Generational Loop
%%%
%%%
flag_solution=0;
while generation<maxgeneration & flag_solution==0
   
   if save_flag==1 % Backup copies of current generation
      save 'neatsave' population generation innovation_record species_record
   end
      
   % call evaluation function (in this case XOR), fitnesses of individuals will be stored in population(:).fitness
   % IMPORTANT reproduction assumes an (all positive!) evaluation function where a higher value means better fitness (in other words, the algorithm is geared towards maximizing a fitness function which can only assume values between 0 and +Inf) 
   
   population=xor_experiment(population);
   %population=fulladder_experiment(population);
   
   generation

   %compute mean and max raw fitnesses in each species and store in species_record.generation_record
   max_fitnesses_current_generation=zeros(1,size(species_record,2));

   for index_species=1:size(species_record,2)
      if species_record(index_species).number_individuals>0
         [max_fitness,index_individual_max]=max(([population(:).species]==index_species).*[population(:).fitness]);
         mean_fitness=sum(([population(:).species]==index_species).*[population(:).fitness])/species_record(index_species).number_individuals;  
         % Compute stagnation vector (last stagnation.number_generation-1 max fitnesses plus current fitness
         if size(species_record(index_species).generation_record,2)>stagnation.number_generation-2
            stagnation_vector=[species_record(index_species).generation_record(3,size(species_record(index_species).generation_record,2)-stagnation.number_generation+2:size(species_record(index_species).generation_record,2)),max_fitness];
            if sum(abs(stagnation_vector-mean(stagnation_vector))<stagnation.threshold)==stagnation.number_generation %Check for stagnation
               mean_fitness=0.01; %set mean fitness to small value to eliminate species (cannot be set to 0, if only one species is present, we would have divide by zero in fitness sharing. anyways, with only one species present, we have to keep it)
            end
         end         
         species_record(index_species).generation_record=[species_record(index_species).generation_record,[generation;mean_fitness;max_fitness;index_individual_max]];
         max_fitnesses_current_generation(1,index_species)=max_fitness;
      end
   end
   %check for refocus  
   [top_fitness,index_top_species]=max(max_fitnesses_current_generation);
   if size(species_record(index_top_species).generation_record,2)>refocus.number_generation
      index1=size(species_record(index_top_species).generation_record,2)-refocus.number_generation;
      index2=size(species_record(index_top_species).generation_record,2);
      if sum(abs(species_record(index_top_species).generation_record(3,index1:index2)-mean(species_record(index_top_species).generation_record(3,index1:index2)))<refocus.threshold)==refocus.number_generation
         [discard,vector_cull]=sort(-max_fitnesses_current_generation);         
         vector_cull=vector_cull(1,3:sum(max_fitnesses_current_generation>0));
         for index_species=1:size(vector_cull,2)
            index_cull=vector_cull(1,index_species);
            species_record(index_cull).generation_record(2,size(species_record(index_cull).generation_record,2))=0.01;
         end
      end
   end
       
   %visualisation fitness & species
   a=0;
   b=0;
   for index_individual=1:size(population,2)
      a=a+sum(population(index_individual).connectiongenes(5,:)==1);
      b=b+sum(population(index_individual).nodegenes(2,:)==3);
   end
   average_number_non_disabled_connections=[average_number_non_disabled_connections,[a/population_size;generation]];
   average_number_hidden_nodes=[average_number_hidden_nodes,[b/population_size;generation]];
   c=[];
   for index_species=1:size(species_record,2)
      c=[c,species_record(index_species).generation_record(1:3,size(species_record(index_species).generation_record,2))];
   end
   max_overall_fitness=[max_overall_fitness,[max(c(3,:).*(c(1,:)==generation));generation]];
   maximale_fitness=max(c(3,:).*(c(1,:)==generation))
   if maximale_fitness>15.6025

      flag_solution=1;
   end
       
   subplot(2,2,1);
   plot(average_number_non_disabled_connections(2,:),average_number_non_disabled_connections(1,:));
   ylabel('non disabled con');
   subplot(2,2,2);
   plot(average_number_hidden_nodes(2,:),average_number_hidden_nodes(1,:));
   ylabel('num hidden nodes');
   subplot(2,2,3);
   plot(max_overall_fitness(2,:),max_overall_fitness(1,:));
   ylabel('max fitness');
   drawnow;   
    
     
   
   if flag_solution==0
   %call reproduction function with parameters, current population and species record, returns new population, new species record and new innovation record
   [population,species_record,innovation_record]=reproduce(population, species_record, innovation_record, initial, selection, crossover, mutation, speciation, generation, population_size);
   toc;
   end
   %increment generational counter
   generation=generation+1; 
end

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一二区视频| 麻豆精品视频在线观看视频| 日韩午夜精品电影| 欧美日本在线一区| 欧美日韩aaaaaa| 日韩天堂在线观看| 日韩一级视频免费观看在线| 精品噜噜噜噜久久久久久久久试看 | 555www色欧美视频| 欧美三级日韩三级| 欧美女孩性生活视频| 欧美一区二区三区人| 欧美电影免费观看高清完整版在线 | 欧美一区二区三区视频| 欧美在线免费观看亚洲| 欧美天堂一区二区三区| 欧美日韩综合不卡| 日韩亚洲欧美中文三级| 久久久99久久精品欧美| 国产精品美女一区二区| 樱花草国产18久久久久| 天天操天天色综合| 麻豆精品国产传媒mv男同| 国产成人综合网| 在线中文字幕一区二区| 欧美一区二区成人| 国产精品水嫩水嫩| 亚洲国产cao| 激情深爱一区二区| 白白色亚洲国产精品| 欧美性大战xxxxx久久久| 日韩欧美一区二区免费| 国产精品萝li| 日本三级韩国三级欧美三级| 国产精品亚洲一区二区三区妖精| 97久久超碰精品国产| 欧美一区二区视频观看视频| 中文字幕不卡一区| 午夜欧美在线一二页| 国产很黄免费观看久久| 欧美日本视频在线| 国产精品久久毛片| 日韩国产一二三区| av一二三不卡影片| 欧美精品一区二区三区高清aⅴ| 亚洲视频资源在线| 国产一区二区电影| 在线电影院国产精品| 中文字幕亚洲不卡| 韩国女主播一区| 69堂亚洲精品首页| 亚洲日本欧美天堂| 国产成人亚洲精品狼色在线| 欧美一区二区三区在线视频| 亚洲精品免费播放| 成人av电影免费观看| 欧美tickling挠脚心丨vk| 亚洲国产欧美另类丝袜| 99久久综合狠狠综合久久| 久久久噜噜噜久久人人看| 婷婷久久综合九色综合绿巨人| 色综合久久久久久久久久久| 国产欧美精品一区二区色综合| 美日韩黄色大片| 6080亚洲精品一区二区| 亚洲国产视频直播| 色综合天天性综合| 国产精品久久久久久久久免费樱桃| 国内精品免费在线观看| 欧美一区二区三区免费在线看| 亚洲一区二区欧美| 在线观看国产日韩| 一区二区三区国产精品| 91黄色免费网站| 亚洲制服丝袜av| 欧美婷婷六月丁香综合色| 亚洲精品成人天堂一二三| 色综合久久99| 亚洲一区二区三区在线| 在线欧美小视频| 亚洲不卡一区二区三区| 777久久久精品| 激情久久五月天| 久久影院午夜论| 成人黄色国产精品网站大全在线免费观看| 久久久精品欧美丰满| 成人av免费观看| 一区二区在线观看免费| 欧美日韩激情一区二区| 日韩成人午夜电影| 精品久久久久久最新网址| 国产成人一级电影| 亚洲欧美日韩电影| 欧美精品日日鲁夜夜添| 狠狠色综合日日| 日韩理论片中文av| 欧美日韩不卡在线| 国产激情91久久精品导航| 1区2区3区国产精品| 欧美在线高清视频| 精品制服美女久久| 国产精品成人在线观看| 欧美巨大另类极品videosbest | 欧美一级国产精品| 国产一区二区三区蝌蚪| 亚洲人亚洲人成电影网站色| 欧美三区在线视频| 国产伦精品一区二区三区免费| 国产精品伦理一区二区| 欧美日韩的一区二区| 成人一区在线观看| 午夜精品在线视频一区| 欧美国产一区视频在线观看| 欧美亚洲一区二区三区四区| 国产揄拍国内精品对白| 亚洲与欧洲av电影| 欧美激情艳妇裸体舞| 欧美日韩国产中文| 波波电影院一区二区三区| 蜜臀av在线播放一区二区三区| 国产精品情趣视频| 欧美xxxxx裸体时装秀| 一本大道久久精品懂色aⅴ| 久久99久久99精品免视看婷婷 | 久久久久一区二区三区四区| 在线观看区一区二| 国产精品影音先锋| 丝袜亚洲另类丝袜在线| 日韩毛片高清在线播放| 久久久精品蜜桃| 日韩一区二区精品在线观看| 色偷偷一区二区三区| 国产精品羞羞答答xxdd| 日本欧美在线看| 亚洲亚洲人成综合网络| 国产精品久久久久久户外露出 | 免费的成人av| 亚洲狠狠爱一区二区三区| 国产精品进线69影院| 欧美激情中文不卡| 国产亚洲一区二区在线观看| 欧美一区二区三区免费观看视频| 欧美视频在线观看一区| 色素色在线综合| 色综合久久久久久久| av成人老司机| 99视频精品免费视频| www.av亚洲| 99国产精品一区| 91色porny蝌蚪| 色综合久久综合| 色激情天天射综合网| 成人18视频日本| 99久久精品免费| 91麻豆.com| 色视频欧美一区二区三区| 色综合色狠狠综合色| 91蜜桃在线免费视频| 91在线视频官网| 一本色道久久综合亚洲aⅴ蜜桃| 99精品视频一区二区三区| 91在线视频播放| 在线亚洲欧美专区二区| 精品污污网站免费看| 欧美日韩一卡二卡三卡| 欧美精品国产精品| 91精品国产色综合久久不卡电影| 日韩一区二区在线观看| 精品国产制服丝袜高跟| 国产午夜亚洲精品午夜鲁丝片| 国产色产综合产在线视频| 国产精品久久777777| 亚洲综合精品久久| 免费一级片91| 国产一区二区精品久久91| av电影在线不卡| 欧美伦理电影网| 久久你懂得1024| 亚洲欧美电影一区二区| 视频一区国产视频| 黑人巨大精品欧美黑白配亚洲| 高清不卡一区二区| 色一情一伦一子一伦一区| 欧美久久久久久久久久| 26uuu国产电影一区二区| 亚洲欧洲成人自拍| 天堂精品中文字幕在线| 粉嫩在线一区二区三区视频| 日本精品一区二区三区高清| 日韩午夜精品电影| 亚洲欧洲av在线| 天堂资源在线中文精品| 粉嫩aⅴ一区二区三区四区| 欧美视频在线不卡| 国产欧美日韩麻豆91| 亚洲午夜在线电影| 成人网页在线观看| 91精品国产综合久久香蕉麻豆| 国产肉丝袜一区二区| 热久久一区二区|