subpopulations and parallel processing in ga
17 ビュー (過去 30 日間)
古いコメントを表示
Hey everybody, I am having a problem with running ga using subpopulations and I found the same questionn here asked by Fred but not really answered by anyonehttps://de.mathworks.com/matlabcentral/answers/345905-genetic-algorithm-and-parallel-processing
I wonder why there is an option to specify subpopulations in ga if it does not bring any benefit? Is there any possibility to enable parallel processing with subpopulations in ga ?
Many Thanks
Qi
0 件のコメント
回答 (2 件)
Walter Roberson
2019 年 3 月 1 日
If you find toolbox/globaloptim/globaloptim/ (which is where ga.m lives) and look inside private/ then there is a migrate.m that only takes effect for non-scalar populations. It is called from galincon() for ga with linear constraints; called by gaunc() for ga with no constraints; by gamultiobjsolve() for gamultiobj. If there are nonlinear constraints then gacon() ends up creating subproblems and calling galincon() or gaunc()
It is possible that there are combinations of conditions under which migrate() does not end up getting called.
migrate() does not invoke any Parallel Computing. What it does is examine cells of population data and move some entries between cells. Then until the next migration phase, each of those populations evolves independently of each other -- but not in separate workers (processes.)
I do not know why the documentation appears to imply that migration does not take place or that the migration options have no effect. It is possible that the documentation is out of date.
0 件のコメント
Stephan
2019 年 3 月 1 日
編集済み: Stephan
2019 年 3 月 1 日
Hi,
"...Subpopulations refer to a form of parallel processing for the genetic algorithm. ga currently does not support this form. In subpopulations, each worker hosts a number of individuals. These individuals are a subpopulation. The worker evolves the subpopulation independently of other workers, except when migration causes some individuals to travel between workers.
Because ga does not currently support this form of parallel processing, there is no benefit to setting PopulationSize to a vector, or to setting the MigrationDirection, MigrationInterval, or MigrationFraction options..."
Maybe TMW plans to introduce this feature in a future release - we can not know and they wont tell us i guess.
For the moment you can only use the following informations / features regarding parallel computation in ga:
"...ga computes the objective function and nonlinear constraint values of the individuals in a population in parallel...Even when running in parallel, ga occasionally calls the fitness and nonlinear constraint functions serially on the host machine. Therefore, ensure that your functions have no assumptions about whether they are evaluated in serial or parallel..."
You find informations related to this topic here:
This is what you can expect at the moment regarding the parallel computations in ga.
To make it short:
It is said clearly:
"...there is no benefit to setting PopulationSize to a vector, or to setting the MigrationDirection, MigrationInterval, or MigrationFraction options..."
Best regards
Stephan
9 件のコメント
Walter Roberson
2019 年 3 月 4 日
? The appropriate functions already have calls to migrate() in them. I did not see anything obvious that would turn off those calls, so it looks to me as if it is implemented ??
Alan Weiss
2019 年 3 月 5 日
Implemented, sort of, but not in parallel, which is the main reason to use subpopulations.
Qi Liu, if you want to rewrite the code to perform in parallel, well, the code is there for you to see and modify as you please. But I can tell you that it is unlikely to be a worthwhile investment of your time. In fact, I rarely find it worthwhile to use ga for any reason except nonlinear mixed-integer programming in small dimensions. You would almost always be better off using Optimization Toolbox™ functions for smooth optimization problems, possibly with MultiStart for searching for a global solution, or using patternsearch for nonsmooth problems.
Alan Weiss
MATLAB mathematical toolbox documentation
参考
カテゴリ
Help Center および File Exchange で Get Started with Optimization Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!