Closed NH-VII closed 3 years ago
Hi,
Thanks for this note.
One location the cal_pop_fitness()
was called another time in each generation is inside the best_solution()
method. Now, the best_solution()
method accepts a new optional argument called pop_fitness
which accepts an array of the previously calculated fitness values. If this argument is left None
, then the a new call to the cal_pop_fitness()
method is done.
This change [alongside some additional features like training PyTorch models and supporting adaptive mutation] is reflected in the new release of PyGAD 2.10.0. Please check the documentation for more information: https://pygad.readthedocs.io
Please let me know if there are any other possible enhancements to be made.
Thanks.
Hi, thank you for your kind reply and for the amazing work behind this module! I am going to update to 2.10.0 as soon as possible. If I notice something else during my next GA projects, I will let you know.
Hi,
Thanks again for your feedback.
Looking for your future feedback as it really helps.
The
fitness_func
method is called more then ones for each generation. This can be avoided using the previous calculated fitness instead calling againfitness_func
orcal_pop_fitness
. This issue is relevant if the fitness calculation is high demanding (like the final score of a videogame match).