Genetic algorithms, Mona Lisa and JavaScript + Canvas
blog.nihilogic.dk
Genetic algorithms, Mona Lisa and JavaScript + Canvas
1–10 of 22 posts
Re: Genetic algorithms, Mona Lisa and JavaScript + Canvas
#2It seems the default mutation parameters are a bit low, if you increase it it may lead to better results
I think the main problem with this is that it's using a fixed number of polygons, and apparently is mutating their vertice positions.
If it could be changed for a range of polygons (with a range of vertices, let's say from 3-6) maybe it can converge faster (and better)
But it is nonetheless a very nice experiment. GA/GP is one of those things that really can work with "untractable" questions.
Re: Genetic algorithms, Mona Lisa and JavaScript + Canvas
#3So take your every triangle vertex (x,y) and differentiate against the fitness (using finite difference), then gradient accent on that parameterization. That will let the triangles fit the edges effectively (I am thinking Mondrian here primarily)
Re: Genetic algorithms, Mona Lisa and JavaScript + Canvas
#4I recently entered a competition (February 2013) and used this technique without having seen this blog. I also used webworkers and SVG.
Source: https://github.com/binarymax/randriaan Demo: http://binarymax.com/randriaan.html
Sorry, FF or Chrome only (because of how I load the webworkers from the same page)
@tlarkworthy - I had a version that did 12 images for each generation and chose the best - It was a better result but it really throttled the CPU and took down the browser on my weaker machine, so went with the single thread.
Re: Genetic algorithms, Mona Lisa and JavaScript + Canvas
#5http://alteredqualia.com/visualization/evolve/
[1] comments: https://news.ycombinator.com/item?id=392036
Re: Genetic algorithms, Mona Lisa and JavaScript + Canvas
#6Re: Genetic algorithms, Mona Lisa and JavaScript + Canvas
#7Re: Genetic algorithms, Mona Lisa and JavaScript + Canvas
#8Different images work best with different polygon sizes, different cut-offs etc. and it's really sensitive. If I change the parent cutoff for example, a simple 0.01 change seems to ruin Mondrian from forming, even after waiting several thousand mutations.
Re: Genetic algorithms, Mona Lisa and JavaScript + Canvas
#9Note how much faster it runs today: 1966 mutations took 120 minutes back then, today it performed ~2100 mutations in about 4 minutes.
DNA here: http://pastebin.com/PEGwKvG4