Re:Show HN: A Genetic Algorithm library written in JavaScript
by bmh100 on Friday August 14, 2020 @02:08PM
(#24161223)
I like the cleanliness of the library. I learned about and used GAs in college. It is important for this library to have the ability to hold out the fittest candidate so far. This avoids the situation where a good solution is lost because the population evolves away from it. Optionally, the best candidate can be retained for breeding. Deleting unfit solutions should be a parameter. Breeding partner selection should also be weighted by fitness.
[ Parent
| on HN ]
Re:Show HN: A Genetic Algorithm library written in JavaScript
by djaque on Friday August 14, 2020 @03:09PM
(#24161998)
The idea of choosing partners based on fitness is implemented in most GAs. It's called selection and a basic form looks like choosing two individuals for each parent and only breeding the fittest in each pair (tournament selection).
Many frameworks also include a "hall of fame" to avoid evolving away from a good point like you mentioned.
Re:Show HN: A Genetic Algorithm library written in JavaScript
by bmh100 on Friday August 14, 2020 @04:12PM
(#24162695)
The type of selection I was talking about is called "fitness proportionate selection"[1]. I prefer it, mainly because I am more familiar with it.
[1]: https://en.wikipedia.org/wiki/Fitness_proportionate_selectio...
Re:Show HN: A Genetic Algorithm library written in JavaScript
by bmh100 on Friday August 14, 2020 @04:24PM
(#24162803)
What do you recommend as good GA frameworks?
Re:Show HN: A Genetic Algorithm library written in JavaScript
by djaque on Friday August 14, 2020 @04:32PM
(#24162909)
DEAP is the well known framework in python.
Re:Show HN: A Genetic Algorithm library written in JavaScript
by nyxyn on Friday August 14, 2020 @02:34PM
(#24161555)
Thanks for your comment. This algorithm keeps the best candidates through every generation.
Re:Show HN: A Genetic Algorithm library written in JavaScript
by bmh100 on Friday August 14, 2020 @04:08PM
(#24162643)
I see that, but the best candidate of the current generation is not necessarily the best candidate ever seen. Reproduction and mutation can lead to the best solution of a given generation being worse than the generation before it.
Re:Show HN: A Genetic Algorithm library written in JavaScript
by phyzix5761 on Saturday August 15, 2020 @10:39AM
(#24169187)
The best candidate is always kept throughout the whole evolution process. If you find the best candidate in the second generation, for example, it will be kept all the way to the end.