Genetic Algorithms - unexpectedly high, variable, number of f-counts

조회 수: 13 (최근 30일)
Kilin
Kilin 2014년 2월 1일
답변: Kilin 2014년 2월 3일
Hi everyone,
I am experimenting with genetic algorithms, Global Optimization Toolbox. My problem is bounded.
My fitness is quite heavy to be evaluated (about 30 seconds each evaluation), so my execution times are quite long. Examining the f-count, I noticed a high number of fitness evaluations that - from my basic understanding of genetic algorithms - I was not expecting: I would like to understand why this happens, hope you can help me.
Why the f-count is much higher than population_size * iteration?
For example, I have population_size = 100. I expected 100 evaluations each run, so f-count to be 100 at iteration 1, 200 at iteration 2, 300 at iteration 3 and so on. At the end I expected population_size * generations evaluations.
Instead, I've printed the f-count at each iteration, and with five generations I get something like that (I post also gaoptions, as it may be useful to understand the problem):
gaoptions =
PopulationType: []
PopInitRange: []
PopulationSize: 100
EliteCount: []
CrossoverFraction: []
ParetoFraction: []
MigrationDirection: []
MigrationInterval: []
MigrationFraction: []
Generations: 100
TimeLimit: 36000
FitnessLimit: []
StallGenLimit: []
StallTimeLimit: []
TolFun: []
TolCon: []
InitialPopulation: []
InitialScores: []
InitialPenalty: []
PenaltyFactor: []
PlotInterval: []
CreationFcn: @gacreationlinearfeasible
FitnessScalingFcn: []
SelectionFcn: []
CrossoverFcn: []
MutationFcn: @mutationadaptfeasible
DistanceMeasureFcn: []
HybridFcn: []
Display: 'iter'
PlotFcns: {1x6 cell}
OutputFcns: []
Vectorized: []
UseParallel: 'always'
Generation f-count
1 5300
2 10500
3 15700
4 25800
5 35900
> output_struct.funccount
ans =
35900
f-count is more than 50 times the value I expected each run. Moreover, if I try running again the same code, I notice slightly different numbers of f-count, as you can see from this log:
Generation f-count
1 5300
2 10500
3 15700
4 22700
5 32800
>> output_struct.funccount
ans =
32800
So basically I expected hundreds of evaluations, but I get thousands. Moreover, the number of f-counts is variable. The result is that it took forever to run the algorithm, and I have to manually stop the algorithm at few iterations.
Could you please explain why I have such a high number of function evaluations? And also, why the number of evaluations changes at each iteration, and in different runs? I don't get this mismatch between the number of individuals and the number of fitness calls.
I would like to mention also another problem related to execution time: the algorithm seems to ignore the TimeLimit that I set. Yesterday I set a limit of 10 hours, and after 19 it was still running. Any idea?
Thank you very much.
Best regards

채택된 답변

Alan Weiss
Alan Weiss 2014년 2월 3일
I assume that you have at least one nonlinear constraint. In this section of the documentation, the penultimate paragraph states:
Each subproblem solution represents one generation. The number of function evaluations per generation is therefore much higher when using nonlinear constraints than otherwise.
Alan Weiss
MATLAB mathematical toolbox documentation

추가 답변 (1개)

Kilin
Kilin 2014년 2월 3일
My problem is bounded, so I think this is actually what's going on. Thank you very much for the pointer, Alan.
Best regards

카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by