Population history #178
Unanswered
juan11iguel
asked this question in
Q&A
Replies: 1 comment
-
Hi @juan11iguel ! UDPs in pygmo are stateful objects, so if you want to track the history of the decision vectors "seen" by the problem you can just add a tiny bit of code to the objective function that appends the decision vector/fitness to a list to be stored as a data member of the UDP. After your UDP has been wrapped in a pygmo problem, you can fetch a reference to it via the https://esa.github.io/pygmo2/problem.html#pygmo.problem.extract |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I wonder if there is a way to store the population states for every generation i.e. to have a population history. This would allow to visualize how the population evolves over the algorithm generations/iterations.
I was thinking about a hacky way where my fitness function could update a file with the given decision vector and its fitness, but this would impact performance of the fitness function (not that it would matter much since my fitness function is already slow anyway.. 😅). Yet it would not have a way to associate each decision vector to some individual ID, or to which generation/iteration the decision vector belongs.
Just for reference, looking at how other optimization libraries handle this, Evox implementation can be a good reference with their implementation of an Evaluation Monitor (equivalent to
algorithm.get_log
'?) and Population Monitor objects.Related to issue 158 since I guess this would have to be implemented through callbacks.
Beta Was this translation helpful? Give feedback.
All reactions