Live data from Hacker News

Show HN: A Genetic Algorithm library written in JavaScript

github.com

11–20 of 42 posts

Re: Show HN: A Genetic Algorithm library written in JavaScript

#11
post #4

Remember that great old flash thingy where you mutate a boxcar until it drives well, just found out there's a html version: https://rednuht.org/genetic_cars_2/

The thing about GA's is that the GA-part is easy -- it's the fitness function (the simulation here) that is the hard/interesting part. This problem has a nice evaluation fn - the duration of the sim - a lot of problems have what amounts to a binary pass/fail or it's not obvious where to do credit-assignment in your genome.

Re: Show HN: A Genetic Algorithm library written in JavaScript

#12

Nueral network tech went through a weird period and then back to basics (back prop) just with massive computation (and simple activation functions) with fabulous results. I wonder if similar things could be done with other old school techniques like GA. Does anyone know if we have tried massive ones?

I think GA with artificial neuron will be a good combination.

Re: Show HN: A Genetic Algorithm library written in JavaScript

#13
post #5
post #2

interesting. I did proposed a GA framework in my final thesis, but I end up never actually sharing the code, because it the end you have to create most of the code anyways. How to create your population, how to evaluate each individual, how to cross them... My final thesis is in Portuguese, otherwise I'll share a link

Do you have diagrammatic details to share ? That will be easy to understand irrespective of language.

http://dspace.unipampa.edu.br/bitstream/riu/4849/1/Victor%20...

I do intend to take the time to translate it to english.

Re: Show HN: A Genetic Algorithm library written in JavaScript

#14
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.

Re: Show HN: A Genetic Algorithm library written in JavaScript

#16

Are genetic algorithms getting popular again? This was the topic of my senior project 20 years ago. I had barely heard about them since I left university, but all of a sudden within the last six months I'm hearing about them again.

Where are you hearing about them? I haven't personally seen an increase in popularity, but that's not saying much.

Re: Show HN: A Genetic Algorithm library written in JavaScript

#17

A question for the author: is genetic data a thing? If it is what are your thoughts?

I'm not the author, but DNA can be used to encode data. Interpreting your question another way, the parameters of each solution are data, and they metaphorically evolve like genes.

Re: Show HN: A Genetic Algorithm library written in JavaScript

#18
post #7

It looks usable for someone who knows about genetic algorithm. It would be catchy on your repo if you add gif version of a working demo for simple use case such as snake game or something similar.

Thanks so much for your comment. There are some examples here: https://github.com/lodenrogue/genetic-algorithm-js/tree/mast...

Re: Show HN: A Genetic Algorithm library written in JavaScript

#19
post #14

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 a…

Thanks for your comment. This algorithm keeps the best candidates through every generation.

Re: Show HN: A Genetic Algorithm library written in JavaScript

#20
post #14

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 a…

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.

Post reply on HN