Use ga optimization inside the cost/nonlincon function of a ga optimization possilbe?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Dear Matlab Community,
I would like to use a ga optimization within the cost or nonlincon function of another ga optimization. Is this possible in general? I run into strage errors. If I replace the outer ga by fmincon, everything works fine. However, I expect the ga to perform better than fmincon...
Thank you in advance :-)
2 commentaires
John D'Errico
le 5 Jan 2023
Modifié(e) : John D'Errico
le 5 Jan 2023
Is it possible? Yes, though with some caveats, since GA, as a stochastic optimizer of sorts, means that you will not always find the same solution arise from multiple repeat starts. And that alone makes things slightly problematic. GA CANNOT insure it will always find the global optimum. It just tries as hard as it can.
Is your code correct? Surely not, since your code failed, and I just stated it is technically possible.
Where/what is the error in your code? That is impossible to know, since we don't see what you wrote. The only answer here is "Probable user error".
Should GA perform better than FMINCON? Not always. In fact, it will often be the case that fmincon converges more rapidly and to a tighter tolerance than GA for the number of function evals taken.
Walter Roberson
le 5 Jan 2023
In my experience, ga is almost always slower and less precise. It does, however, have theoretical advantages where the function is discontinuous or has multiple basins to explore.
Réponses (1)
Anshuman
le 17 Avr 2023
Yes it is possible but using a GA optimization within the cost or nonlinear constraint function of another GA optimization can lead to performance issues, such as slower convergence and longer computation times. This is because the optimization algorithm needs to evaluate the fitness of each individual in the population, and each evaluation requires running the inner GA optimization.
It is also essential to make sure that the parameters of the inner and outer GA are appropriately configured to avoid conflicts and ensure optimal performance. Also we have to check the compatibility of the objective and constraint functions used in the inner and outer GA optimizations.
In case of errors you can try to use other optimization methods, such as fmincon, to check if this issue is related to the nested GA optimization or not. Also it might be helpful to debug the code to identify the source of the issue.
Hope it helps!
0 commentaires
Voir également
Catégories
En savoir plus sur Genetic Algorithm dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!