What does it mean to supply a "partial" initial population to "gaoptimset" in the Global Optimization Toolbox (R2010a and later)?

2 views (last 30 days)
I am using the genetic algorithm "ga" to perform an optimization and configuring the options for the optimization with "gaoptimset" .  I noticed in the documentation that the 'InitialPopulation' I provide may be "partial".  However, I am not sure what this means, and the documentation for "gaoptimset" is not clear.  What is a "partial" initial population?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 3 Mar 2021
Edited: MathWorks Support Team on 3 Mar 2021
The documentation for "gaoptimset" does not explicitly state what a "partial" initial population is:  
 
InitialPopulationInitial population used to seed the genetic algorithm; can be partialMatrix | {[]}
However, the larger documentation page titled "Genetic Algorithm Options" provides more insight:
Initial population
('InitialPopulation') specifies an initial population for the genetic algorithm. The default value is [], in which case ga uses the default
Creation function
to create an initial population. If you enter a nonempty array in the
Initial population
field, the array must have no more than
Population size
rows, and exactly
Number of variables
columns. In this case, the genetic algorithm calls a
Creation function
to generate the remaining individuals, if required.
Therefore, a "partial" initial population simply refers to an initial population with fewer individuals than the specified (or default) population size.  As an example, compare the population sizes of the initial and final populations in the following example:
rf2 = @(x)rastriginsfcn(x/10); % objective function
x0 = [20,30]; % starting point away from the minimum
initpop = 10*randn(20,2) + repmat([10 30],20,1); % generate an initial population
% specify a larger population than the size of the initial population
opts = gaoptimset('PopulationSize', 100, 'InitialPopulation',initpop);
% run the optimization
[xga fga flga oga,pop] = ga(rf2,2,[],[],[],[],[],[],[],opts);
The initial population "initpop" consists of only 20 individuals, but the specified 'PopulationSize' (and the number of rows in the final population "pop") is 100 individuals.

More Answers (0)

Products


Release

R2014a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!