Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store the optimal information in the history file #283

Open
ewu63 opened this issue Feb 25, 2022 · 5 comments
Open

Store the optimal information in the history file #283

ewu63 opened this issue Feb 25, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@ewu63
Copy link
Collaborator

ewu63 commented Feb 25, 2022

Description of feature

The optimal design is stored in the solution object, but not in the history file (remember that the final iteration may not be the optimal solution). Similar to the last key, we should have an optimal key or something that stores the callCounter corresponding to the optimal solution.

Potential solution

This may require stepping through the solution to try and match a callCounter, maybe that's a bit hacky?

@ewu63 ewu63 added the enhancement New feature or request label Feb 25, 2022
@cherifM
Copy link

cherifM commented Feb 25, 2023

Hi @nwu63 ,
about your potential solution, can you provide example , or python code to show what you mean, i my trying to get the the same "optimal" solution when i run nsga2, and i end up using last which differ from "optimal(s)" solution,
best regards

@ewu63
Copy link
Collaborator Author

ewu63 commented Feb 25, 2023

This issue is about finding the optimal solution in the history object. The information is already present in the solution object returned by the optimizer, e.g. sol.xStar. Note that sol.fStar was broken for NSGA2, but I opened a PR to fix it in #330. Once it is merged, the solution object should behave as expected. Docs on the solution object can be found here.

@cherifM
Copy link

cherifM commented Feb 25, 2023

@nwu63 thanks a lot for your comment,
best reagards
cherifM

@cherifM
Copy link

cherifM commented Feb 26, 2023

@nwu63 do you have test nsga2 for optimise single objective function?
An other question, after several generations, i get final solution exactly the same initial solution x0, do you have any way to plot progress of the Fitness function versus the generation?

@ewu63
Copy link
Collaborator Author

ewu63 commented Feb 26, 2023

In the future, please open new issues since your questions are totally unrelated to this issue.

I did add a test for NSGA2 when only a single objective function is present, see #330. For plotting, please see the documentation on postprocessing here. I am not sure if we have something that matches up each generation, since pyOptSparse is primarily focused on gradient-based optimizers and not population-based ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants