遗传算法(GA)和遗传规划(GP)是一个有趣的研究领域。
我想知道你使用GA/GP解决的具体问题,以及如果你没有自己的库/框架,你使用了什么库/框架。
问题:
你用GA/GP解决过什么问题? 你使用了哪些库/框架?
我在寻找第一手的经验,所以请不要回答,除非你有。
遗传算法(GA)和遗传规划(GP)是一个有趣的研究领域。
我想知道你使用GA/GP解决的具体问题,以及如果你没有自己的库/框架,你使用了什么库/框架。
问题:
你用GA/GP解决过什么问题? 你使用了哪些库/框架?
我在寻找第一手的经验,所以请不要回答,除非你有。
当前回答
在大学期间,我们使用NERO(神经网络和遗传算法的结合)来教游戏中的机器人做出智能决策。非常酷。
其他回答
进化计算研究生班: 开发了TopCoder马拉松比赛49:megpartty的解决方案。我的小组正在测试不同的域表示法,以及不同的表示法如何影响ga找到正确答案的能力。我们为这个问题编写了自己的代码。
Neuroevolution and Generative and Developmental Systems, Graduate Class: Developed an Othello game board evaluator that was used in the min-max tree of a computer player. The player was set to evaluate one-deep into the game, and trained to play against a greedy computer player that considered corners of vital importance. The training player saw either 3 or 4 deep (I'll need to look at my config files to answer, and they're on a different computer). The goal of the experiment was to compare Novelty Search to traditional, fitness-based search in the Game Board Evaluation domain. Results were relatively inconclusive, unfortunately. While both the novelty search and fitness-based search methods came to a solution (showing that Novelty Search can be used in the Othello domain), it was possible to have a solution to this domain with no hidden nodes. Apparently I didn't create a sufficiently competent trainer if a linear solution was available (and it was possible to have a solution right out of the gates). I believe my implementation of Fitness-based search produced solutions more quickly than my implementation of Novelty search, this time. (this isn't always the case). Either way, I used ANJI, "Another NEAT Java Implementation" for the neural network code, with various modifications. The Othello game I wrote myself.
首先,Jonathan Koza的《遗传编程》(在亚马逊上)几乎是一本关于遗传和进化算法/编程技术的书,有很多例子。我强烈建议你去看看。
As for my own use of a genetic algorithm, I used a (home grown) genetic algorithm to evolve a swarm algorithm for an object collection/destruction scenario (practical purpose could have been clearing a minefield). Here is a link to the paper. The most interesting part of what I did was the multi-staged fitness function, which was a necessity since the simple fitness functions did not provide enough information for the genetic algorithm to sufficiently differentiate between members of the population.
我年轻时就尝试过GA。我用Python写了一个模拟器,工作原理如下。
这些基因编码了神经网络的权重。
神经网络的输入是检测触摸的“天线”。较高的数值表示非常接近,0表示不接触。
输出是两个“轮子”。如果两个轮子都向前,这个人也向前。如果轮子方向相反,他就会转向。输出的强度决定了车轮转动的速度。
生成了一个简单的迷宫。这真的很简单,甚至很愚蠢。屏幕下方是起点,上方是球门,中间有四面墙。每面墙都有一个随机的空间,所以总是有一条路。
一开始我只是随机挑选一些人(我认为他们是bug)。只要有一个人达到了目标,或者达到了时间限制,就会计算适合度。它与当时到目标的距离成反比。
然后我把它们配对,“培育”它们来创造下一代。被选择繁殖的概率与它的适应性成正比。有时,这意味着如果一个人具有非常高的相对适应性,就会与自己反复繁殖。
I thought they would develop a "left wall hugging" behavior, but they always seemed to follow something less optimal. In every experiment, the bugs converged to a spiral pattern. They would spiral outward until they touched a wall to the right. They'd follow that, then when they got to the gap, they'd spiral down (away from the gap) and around. They would make a 270 degree turn to the left, then usually enter the gap. This would get them through a majority of the walls, and often to the goal.
我添加的一个功能是在基因中放入一个颜色矢量来跟踪个体之间的相关性。几代之后,它们的颜色都是一样的,这说明我应该有更好的繁殖策略。
我试着让他们制定更好的策略。我把神经网络复杂化了——增加了记忆和其他东西。这没有用。我总是看到同样的策略。
我尝试了各种方法,比如建立单独的基因库,在100代之后才重新组合。但没有什么能促使他们采取更好的策略。也许这是不可能的。
另一个有趣的事情是绘制适应度随时间变化的图表。有明确的模式,比如最大适合度在上升之前会下降。我从未见过一本进化论的书谈到这种可能性。
除了一些常见的问题,如《旅行推销员》和Roger Alsing的《蒙娜丽莎》程序的变体,我还编写了一个进化数独求解器(这需要我自己更多的原创想法,而不仅仅是重新实现别人的想法)。解决数独游戏有更可靠的算法,但进化方法效果相当好。
在过去的几天里,在Reddit上看到这篇文章后,我一直在玩一个进化程序来寻找扑克的“冷牌”。目前还不太令人满意,但我想我可以改进。
我有自己的进化算法框架。
我不知道家庭作业算不算…
在我学习期间,我们推出了自己的程序来解决旅行推销员问题。
我们的想法是对几个标准进行比较(映射问题的难度,性能等),我们还使用了其他技术,如模拟退火。
它运行得很好,但我们花了一段时间来理解如何正确地进行“复制”阶段:将手头的问题建模成适合遗传编程的东西,这对我来说是最难的部分……
这是一门有趣的课程,因为我们也涉猎了神经网络之类的知识。
我想知道是否有人在“生产”代码中使用这种编程。