DEAP / deap

Distributed Evolutionary Algorithms in Python
http://deap.readthedocs.org/
GNU Lesser General Public License v3.0
5.86k stars 1.13k forks source link

GP - Beginner's doubt #511

Open ericlluz opened 4 years ago

ericlluz commented 4 years ago

HI, I would like to congratulate you on this project. It is one of the few GP implementations.

I have a beginner's doubt. In GP, how do I use selDoubleTournament () and migRing ()? I have not found any example of using these functions.

Another doubt, the deap.tools.DeltaPenalty function does not accept parallelization?

Thank you, Eric

DMTSource commented 3 years ago

You can try replacing your standard tournament selection with:

toolbox.register("select", tools.selDoubleTournament, 
                           fitness_size=7,
                           parsimony_size=1.4,
                           fitness_first=True) 

Docs reference: https://deap.readthedocs.io/en/master/api/tools.html#deap.tools.selDoubleTournament

For migRing: Docs: https://deap.readthedocs.io/en/master/api/tools.html#deap.tools.migRing Example: https://gist.github.com/cmd-ntrf/2198880

Parallelization pretty much applies to evaluation, or anything that happens to use tools.map once you go multiprocess.