TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Grow Your Own Picture – Genetic Algorithms and Generative Art

123 点作者 altern8超过 10 年前

16 条评论

antirez超过 10 年前
It looks like it no longer does much progresses after some time. Many years ago I wrote one of those stuff, just a few days after the famous 2008 blog post doing the same (<a href="http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/" rel="nofollow">http:&#x2F;&#x2F;rogeralsing.com&#x2F;2008&#x2F;12&#x2F;07&#x2F;genetic-programming-evolut...</a>). However after some time I switched the code to use simulated annealing, and it performed better. I&#x27;m running it for a few minutes against the Monalisa image to see what happens. Btw I had a plan to release the code after some cleanup, maybe tonight is the right moment after 6 years of this code hanging on my HD.<p>EDIT: after 6 minutes (64 shapes) -&gt; <a href="http://imgur.com/gyZCjBD" rel="nofollow">http:&#x2F;&#x2F;imgur.com&#x2F;gyZCjBD</a><p>EDIT2: after ~15 minutes -&gt; <a href="http://imgur.com/5XMU8vH" rel="nofollow">http:&#x2F;&#x2F;imgur.com&#x2F;5XMU8vH</a><p>Now trying using just triangles, again with 64 shapes, I remember it was much better than when using circles for most images.<p>EDIT3: Oh, much better now, after 6 minutes (64 triangles) -&gt; <a href="http://imgur.com/x9E9TmK" rel="nofollow">http:&#x2F;&#x2F;imgur.com&#x2F;x9E9TmK</a><p>EDIT4: 10 minutes more and she got a nose: <a href="http://imgur.com/bX8UTIQ" rel="nofollow">http:&#x2F;&#x2F;imgur.com&#x2F;bX8UTIQ</a><p>EDIT5: Code released! <a href="https://news.ycombinator.com/item?id=8710418" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8710418</a>
评论 #8710200 未加载
评论 #8710302 未加载
评论 #8711433 未加载
fogleman超过 10 年前
This guy did the same thing in 2008:<p><a href="http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/" rel="nofollow">http:&#x2F;&#x2F;rogeralsing.com&#x2F;2008&#x2F;12&#x2F;07&#x2F;genetic-programming-evolut...</a>
评论 #8710492 未加载
评论 #8710312 未加载
评论 #8710108 未加载
RogerAlsing超过 10 年前
Nice to see another spinoff :) Great to see this post now since it is exactly 6 years since my EvoLisa post was released today :)
评论 #8710688 未加载
thisisdave超过 10 年前
I&#x27;m having fun with this, thanks for posting it.<p>I&#x27;d love to see reports of basic genetic genetic properties of the population. What&#x27;s the variance in fitness within each generation? This turns out to be <i>the</i> key factor in the rate of evolution [1], assuming that one defines fitness the way that geneticists do.<p>Also, estimates of the relative strengths of mutation, selection, and drift would be nice, as would options for distinguishing between hard and soft selection. These sorts of diagnostics and options could really improve the method&#x27;s effectiveness.<p>[1] <a href="https://en.wikipedia.org/wiki/Fisher%27s_fundamental_theorem_of_natural_selection" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Fisher%27s_fundamental_theorem...</a>
pavlov超过 10 年前
Why is the collection of properties for an individual mutated shard called DNA? It doesn&#x27;t really have anything to do with the actual molecule, as far as I can tell...<p>By the same logic, this is a C2H6O simulator:<p><pre><code> var s = &quot;I&#x27;m going to get drunk&quot;; for (var i = 0; i &lt; 10000; i++) { var idx = Math.floor(Math.random()*s.length); var c = s.substr(idx, 1); s = s.substr(0, idx) + s.substr(idx-1, s.length-1-idx); idx = Math.floor(Math.random()*s.length); s = s.substr(0, idx) + c + s.substr(idx, s.length-idx); } </code></pre> (Wow, the downvotes are aggressive these days. Relax - it&#x27;s just a joke!)
评论 #8709928 未加载
评论 #8709934 未加载
netcraft超过 10 年前
A few years ago I wrote a genetic algorithm to solve a travelling salesman problem - it was a ton of fun - I need to port it to JS one day.<p>Ive also thought about making an algorithm that would breed JS programs to solve basic tasks - sort an array of input or find the longest consecutive group of numbers. Maybe one day I&#x27;ll find the time.
评论 #8710214 未加载
评论 #8710103 未加载
gus_massa超过 10 年前
It&#x27;s very difficult for the algorithm to optimize the hexagons. If you change the number of vertices from 6 to 3, it runs slightly faster but the results are much better.
kendallpark超过 10 年前
I love genetic algorithms. I wrote one for the 0-1 knapsack problem back in school, then used a genetic-ish algorithm (didn&#x27;t have enough time for a true GA) to win a rock paper scissors tourney at work.<p>It seems to me that one needs another genetic algorithm to manage all the variables (such as mutation rate, population size, crossover, etc) because they have such an impact on the effectiveness of the algorithm.<p>Gives me way more respect for mother nature. ;)
评论 #8710541 未加载
darkFunction超过 10 年前
I wrote something similar- first I did a hill climbing implementation and then a genetic one. The genetic algorithm worked way better:<p><a href="https://github.com/darkFunction/PolygonPainter" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;darkFunction&#x2F;PolygonPainter</a>
gabemart超过 10 年前
Great project. Love that it&#x27;s configurable and open source. The analytics are a nice touch. I&#x27;m a little confused by the fitness percentage though. 98% or even 99% fitness seems to have very little immediate resemblance to the target image.
评论 #8710647 未加载
userbinator超过 10 年前
It&#x27;d be nondeterministic and quite time-consuming, but this suggests an image compression algorithm that could conceivably come up with <i>very</i> compact representations of its input.
评论 #8711773 未加载
ada1981超过 10 年前
would be cool to be able to upload your own photos &#x2F; pull in from instagram, etc.<p>you might make a little coin by piping the finished images to a t-shirt or skin printer.<p>we&#x27;d be happy to give a free CreditCover, credit card skin to any one who wants one using your imagery. We have a standing $10 gift code for hacker news users (hackernews) but we could make something specific for you if you like.<p>CreditCovers.com&#x2F;DIY<p>cool!
based2超过 10 年前
<a href="https://news.ycombinator.com/item?id=8696255" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8696255</a>
andmarios超过 10 年前
Every now and then comes an interesting algorithm implementation in javascript alas always single threaded. :&#x2F;
评论 #8711412 未加载
danielweber超过 10 年前
For fun: start with one picture, then it run for a while, and then change the source picture
imaginenore超过 10 年前
This looks more like hill climbing rather than genetic.<p><a href="http://en.wikipedia.org/wiki/Hill_climbing" rel="nofollow">http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Hill_climbing</a>