遗传算法(GA)和遗传规划(GP)是一个有趣的研究领域。
我想知道你使用GA/GP解决的具体问题,以及如果你没有自己的库/框架,你使用了什么库/框架。
问题:
你用GA/GP解决过什么问题? 你使用了哪些库/框架?
我在寻找第一手的经验,所以请不要回答,除非你有。
遗传算法(GA)和遗传规划(GP)是一个有趣的研究领域。
我想知道你使用GA/GP解决的具体问题,以及如果你没有自己的库/框架,你使用了什么库/框架。
问题:
你用GA/GP解决过什么问题? 你使用了哪些库/框架?
我在寻找第一手的经验,所以请不要回答,除非你有。
当前回答
Several years ago I used ga's to optimize asr (automatic speech recognition) grammars for better recognition rates. I started with fairly simple lists of choices (where the ga was testing combinations of possible terms for each slot) and worked my way up to more open and complex grammars. Fitness was determined by measuring separation between terms/sequences under a kind of phonetic distance function. I also experimented with making weakly equivalent variations on a grammar to find one that compiled to a more compact representation (in the end I went with a direct algorithm, and it drastically increased the size of the "language" that we could use in applications).
最近,我将它们用作默认假设,以此来测试由各种算法生成的解决方案的质量。这主要涉及分类和不同类型的拟合问题(即创建一个“规则”,解释审查员对数据集所做的一组选择)。
其他回答
几周前,我提出了一个关于SO的解决方案,使用遗传算法来解决图布局的问题。这是一个约束优化问题的例子。
同样在机器学习领域,我用c/c++从头开始实现了一个基于ga的分类规则框架。 我还在一个示例项目中使用了GA来训练人工神经网络(ANN),而不是使用著名的反向传播算法。
此外,作为我研究生研究的一部分,我已经使用GA来训练隐马尔可夫模型,作为基于em的Baum-Welch算法的额外方法(还是在c/c++中)。
As part of my undergraduate CompSci degree, we were assigned the problem of finding optimal jvm flags for the Jikes research virtual machine. This was evaluated using the Dicappo benchmark suite which returns a time to the console. I wrote a distributed gentic alogirthm that switched these flags to improve the runtime of the benchmark suite, although it took days to run to compensate for hardware jitter affecting the results. The only problem was I didn't properly learn about the compiler theory (which was the intent of the assignment).
我本可以用现有的默认标志来播种初始种群,但有趣的是,算法发现了一个与O3优化级别非常相似的配置(但实际上在许多测试中更快)。
编辑:我还用Python写了我自己的遗传算法框架,只是使用popen命令来运行各种基准测试,尽管如果不是评估作业,我会看看pyEvolve。
除了一些常见的问题,如《旅行推销员》和Roger Alsing的《蒙娜丽莎》程序的变体,我还编写了一个进化数独求解器(这需要我自己更多的原创想法,而不仅仅是重新实现别人的想法)。解决数独游戏有更可靠的算法,但进化方法效果相当好。
在过去的几天里,在Reddit上看到这篇文章后,我一直在玩一个进化程序来寻找扑克的“冷牌”。目前还不太令人满意,但我想我可以改进。
我有自己的进化算法框架。
There was an competition on codechef.com (great site by the way, monthly programming competitions) where one was supposed to solve an unsolveable sudoku (one should come as close as possible with as few wrong collumns/rows/etc as possible).What I would do, was to first generate a perfect sudoku and then override the fields, that have been given. From this pretty good basis on I used genetic programming to improve my solution.I couldn't think of a deterministic approach in this case, because the sudoku was 300x300 and search would've taken too long.
没有家庭作业。
1995年,我作为专业程序员的第一份工作是为标准普尔500指数期货编写一个基于遗传算法的自动交易系统。该应用程序是用Visual Basic 3 [!我不知道我当时是怎么做的,因为VB3甚至没有课程。
The application started with a population of randomly-generated fixed-length strings (the "gene" part), each of which corresponded to a specific shape in the minute-by-minute price data of the S&P500 futures, as well as a specific order (buy or sell) and stop-loss and stop-profit amounts. Each string (or "gene") had its profit performance evaluated by a run through 3 years of historical data; whenever the specified "shape" matched the historical data, I assumed the corresponding buy or sell order and evaluated the trade's result. I added the caveat that each gene started with a fixed amount of money and could thus potentially go broke and be removed from the gene pool entirely.
在对种群的每一次评估之后,幸存者被随机杂交(通过混合来自两个亲本的片段),一个基因被选择为亲本的可能性与它产生的利润成正比。我还添加了点突变的可能性,让事情变得有趣一点。经过几百代这样的基因,我最终得到了一个基因群,它可以把5000美元变成平均约10000美元,而且没有死亡/破碎的可能性(当然是在历史数据上)。
Unfortunately, I never got the chance to use this system live, since my boss lost close to $100,000 in less than 3 months trading the traditional way, and he lost his willingness to continue with the project. In retrospect, I think the system would have made huge profits - not because I was necessarily doing anything right, but because the population of genes that I produced happened to be biased towards buy orders (as opposed to sell orders) by about a 5:1 ratio. And as we know with our 20/20 hindsight, the market went up a bit after 1995.