Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork495
usage of new "save_solutions" option#57
-
Usage of new "save_solutions" optionI'm saving the solutions withsave_solutions=True and adjusted the fitness-calculation so that only former unseen, thus new solutions will be executed ( ~ a second each). It is then possible to save much time.. My GA has 20 genes and I did run withstop_criteria='saturate_20' Modus 1
Modus 2
Speed-Factor:Sincenum_parents_mating=200 is half as high assol_per_pop=400, I suppose that 50% of all 400 solutions per generation are known, thus not recalculated, which results in the doubled speed. Theoretically this increases further, if solutions from generations long ago are "seen" again. Conclusion:The saving-feature is available in PyGAD > 2.16.0 and it is great that there are plans of implementing a feature to neglect the redundant calculation of already calculated fitness results for known solutions. Each time the fitness calculation takes more time than just a few ms (in my example around a second), this approach obviously does make sense. One can access the data via:
Beyond the saving of solutions + their fitness, the described functionality has been added independantly from PyGAD. But, as this example does show, it makes sense in certain use cases, to NOT recalculate the fitness for known solutions again and again. |
BetaWas this translation helpful?Give feedback.