Closed stared closed 6 years ago
We really like the name evol
but I may be willing to add a method, at least as a light joke.
@rogiervandergeer any thoughts on .breed
vs. .reproduce
?
So here's a thought.
There may be a use-case for adding .reproduce
as a verb: as a sugar for asexual reproduction.
def generate(parent):
return parent + noise()
# the next two lines could be equivalent
pop.reproduce(make_child)
pop.breed(parent_picker = lambda pop: random.choice(pop), combiner = generate)
So wouldn't mind adding a reproduce
method, als long as we find a clear purpose.
I would find it rather counterintuitive when reproduce
is only asexual
Thinking out loud.
It feels safe to say that most evol algorithms will have two parents that are picked based on fitness_score. The probability of a parent being chosen is:
p(parent) = individual.fitness / sum[i.fitness for i in population]
As far as a base setting goes. I think this is fine and this is one less thing you need to set.
Would this be good enough as an alternative for breed
?
The thing is... breed
as a word really suggests that we are being very selective about which parents can breed together. This is how the ye old farmers cross bred sheep. Whereas the word reproduce
suggests that the population of animals can figure out who the parents are themselves.
I'm starting to like this verb, mainly because this makes it easier for beginners to get started and for many applications you don't need to have a custom method of selecting parents.
I like the verb too. So you are suggesting reproduce
will be a breed
but with a default parent picker? Then why don't we provide the parent picker as a default argument to breed
?
You make a valid point there.
Something tells me that having a .reproduce
may make it easier for beginners. It feels intuitive to the functional programming people [map-reproduce] and it is one less internal thing to worry about for the computer science students. For me it feels appropriate to have a sugar method for the usual case and a customisable method for the people who feel like doing crazy things [like 3 parents].
Will close this for now. If we get a response that we'd like to have a .reproduce()
method we'll discuss it again.
I know it's kind of arrogant to be some random person hinting for renaming a repo... but I still think it is a good idea. (At PyData Warsaw I chuckled a few times. Yet, 3 days later I still think it is worth doing.)
As it is essentially a functional (map, filter, kind-of-reduce) approach to evolutionary algorithms,
MapReproduce
would capture its spirit in its name.(No, I don't mean renaming any parts of API, at least not for this reason.)