Replies: 1 comment
-
Thanks for using PyGAD! This is indeed a useful request. I adjusted the fitness function to reuse the already calculated parent fitness values rather than calling the fitness function. Check this commit: c87641b Please let me know if you have any suggestions. |
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
-
Hello and thanks for this great python library,
I was going through the code to understand how some parts of the project work and I found a way to optimise the tournament parent selection so that it doesn't compute uncesseray fitness values.
In my case, fitness evaluation can take a lot of time (up to 30s for a solution in some cases) and for some parent selection technique the fitness of the whole population is required.
But for the tournament selection technique, only the fitnesses of the selected individuals need to be computed. For example if I only select 20% of the solutions to be parents of the next generation, and I use a 3 way tournament, I will only need up to 60% of the whole population fitness.
It might require a little bit of redesign of the run function, but it might be possible to skip the full fitness computation and wait for the parent selection to compute the selected solution fitness and store them if they are once again selected to compete.
Beta Was this translation helpful? Give feedback.
All reactions