genetic programming 多边形近似
人工智能选修课…某次讲了遗传算法…
然后就想到了以前看到的一篇文章…
似乎是去年这个时候的…
讲的是某人用遗传算法写了个程序…用50个半透明多边形去近似蒙娜丽莎这幅图…
当时觉得很神奇…
对遗传算法稍微了解了一点后又觉得这个一点点进化的图片很费解…
因为图上的多边形在慢慢增多…
而我本以为遗传算法是固定长度的DNA来进行运算的…
而多边形数量的变化以及顶点数的变化让我感觉有些费解…这是怎么表示又是怎么进行繁衍的呢…
一年过去了…借此机会重新回顾了一下…
仔细看了看原文中的文字…
The procedure of the program is quite simple:
0) Setup a random DNA string (application start)
1) Copy the current DNA sequence and mutate it slightly
2) Use the new DNA to render polygons onto a canvas
3) Compare the canvas to the source image
4) If the new painting looks more like the source image than the previous [...]