ahmedfgad / GeneticAlgorithmPython

Source code of PyGAD, a Python 3 library for building the genetic algorithm and training machine learning algorithms (Keras & PyTorch).
https://pygad.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.79k stars 451 forks source link

Caching of Fitness Values for Elites/Kept Parents #289

Open kingjin94 opened 2 months ago

kingjin94 commented 2 months ago

Hi there,

Thank you for your great toolbox!

I have a question regarding caching of fitness values in pygad. It seems that any elite or kept parents fitness function will always be just retrieved. Is there a way to force recalculation? In my case, the fitness is non-deterministic, and I have local search capabilities, i.e., Lamarkian evolution, that would be especially useful for the promising elites or selected parents to further improve their fitness if they somehow could be evaluated again.