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.89k stars 464 forks source link

Caching of Fitness Values for Elites/Kept Parents #289

Open kingjin94 opened 7 months ago

kingjin94 commented 7 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.