Genetic Algorithm Drifting to Worse Solutions With Each Generation

5 ビュー (過去 30 日間)
Jacob Tracy
Jacob Tracy 2018 年 3 月 29 日
コメント済み: Star Strider 2018 年 3 月 30 日
Hello all, So I am using a genetic algorithm for parameter estimation, and in the past 10 or so attempts a situation such as in the attached picture has been occurring. In that picture, the following was my code:
options = optimoptions('ga','PlotFcn',@gaplotbestf,'PopulationSize',600,'UseParallel',true,'Elitecount', 20,'Generations',50,'SelectionFcn',{@selectiontournament,2},'Display','iter'...
,'InitialPopulationMatrix',Sturt);
[x,fval,exitflag] = ga(@RED_vecfit1,Nvars,[],[],[],[],LB,UB,@RED_nonlinconstraint,options)
My number of variables is 692, and I have no linear constraints, and only an upper bound and lower bound (the first 690 variables are between 0 and 10, and the final two are just -Inf to Inf). My suspicion is that the feasible starting point I fed the algorithm was just located in a bad spot, so the algorithm drifted to a worse solution, because my nonlinear constraint is returning the the results I expect. However even when I do not start with an initial population, the algorithm always jumps up quickly in the beginning and levels off quickly, like an inverse of what it should be doing.
If anyone can tell me if I just chose the worst possible set of parameters for such a high-dimensional problem that would be great.
Also bonus thanks if someone can tell me why that same call (minus the ga options) would cause patternsearch to just shut my computer down? I've been wanting to try patternsearch but it either will run until forever or immediately kick back a barely changed solution set from my initial.
Much thanks! Jacob

回答 (1 件)

Star Strider
Star Strider 2018 年 3 月 29 日
Assuming that you wrote your fitness function correctly, you are optimising 692 parameters, and you have only let it run for 50 generations. You have a 'PopulationSize' of 600, and if you began with a random population (my preference), you simply need to let it run, perhaps to several hundred or even several thousand generations, since it’s going to take time to optimise all those parameters. In my experience, constraints, including parameter limits, slow the convergence.
Genetic algorithms are quite tolerant of less than wonderful initial parameter choices, the reason I always begin with a random population.
  2 件のコメント
Jacob Tracy
Jacob Tracy 2018 年 3 月 30 日
I am trying the approach now, and I'm also upping the percentage of Elitecount. Thanks for the advice! Even on parallel my computer runs very slow and I haven't hooked up to the distributed server yet so once I get results I'll share. I appreciate your time.
Star Strider
Star Strider 2018 年 3 月 30 日
My pleasure.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGenetic Algorithm についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by