健康和遗传算法

从R&D Mag –开发一个潜在的拯救生命的数学工具- :

Math and medicine are coming together to help people who have suffered an abdominal aortic aneurysm, which with 15,000 is the 13th-leading cause of death in the United States.

At the heart of the effort are genetic algorithms written by Oak Ridge National Laboratory researchers that allow physicians to more efficiently assess and organize the often vast amounts of information contained in patient reports. Ultimately, with this tool—a sophisticated way to quickly extract key phrases—doctors will be able to characterize features and findings in reports and provide better patient care.

(…)

这项工作建立在涉及乳房摄影开发的遗传算法以往的研究。该系统允许医生快速识别趋势,具体到个别病人和匹配的图像和文字的已知癌症和癌前条件的数据库。

Read这里全文

toggleSign up now!View the newsletter sample.

开发一个潜在的拯救生命的数学工具

Darwin on the track

The Economistarticle:

WHILE watching the finale of the Formula One grand-prix season on television last weekend, your correspondent could not help thinking how Darwinian motor racing has become. Each year, the FIA, the international motor sport’s governing body, sets new design rules in a bid to slow the cars down, so as to increase the amount of overtaking during a race—and thereby make the event more interesting to spectators and television viewers alike. The aim, of course, is to keep the admission and television fees rolling in. Over the course of a season, Formula One racing attracts a bigger audience around the world than any other sport.

Read the这里全文

Meanwhile, at the Hall of Justice!

更新05/10:一篇文章在Physorg了。

有时候,我们面临EC新的应用程序,但对于这个我没想到,从Eurekalert

WASHINGTON, Oct. 5 — Criminals are having a harder time hiding their faces, thanks to new software that helps witnesses recreate and recognize suspects using principles borrowed from the fields of optics and genetics.

(…)

他的软件生成它自己面临着逐步演进到符合证人的回忆。证人开始与一般的描述,例如“我记得一个年轻的白人男子,深色头发。”九个不同的计算机生成的脸,大约适合的描述中产生,且证人识别最佳和最差的匹配。该软件使用了最适合作为模板来自动生成略有微调功能,基于它从拒绝的面孔了解到九个新的面孔。

“Over a number of generations, the computer can learn what face you’re looking for,” says Solomon.

Read the这里全文

N皇后使用Pyevolve问题

Last night I’ve阅读后书签交易马修·罗林斯示出在Python代码来解决Eight Queenspuzzle using EA. So I decided to implement it in Python again but this time using Pyevolve, here is the code:

从pyevolve进口*从随机导入洗牌BOARD_SIZE = 64 DEF queens_eval(基因组):碰撞= 0对于i在x范围(0,BOARD_SIZE):如果我不在基因组:在x范围对于i返回0(0,BOARD_SIZE):山口=False for j in xrange(0, BOARD_SIZE): if (i != j) and (abs(i-j) == abs(genome[j]-genome[i])): col = True if col == True: collisions +=1 return BOARD_SIZE-collisions def queens_init(genome, **args): genome.genomeList = range(0, BOARD_SIZE) shuffle(genome.genomeList) def run_main(): genome = G1DList.G1DList(BOARD_SIZE) genome.setParams(bestrawscore=BOARD_SIZE, rounddecimal=2) genome.initializator.set(queens_init) genome.mutator.set(Mutators.G1DListMutatorSwap) genome.crossover.set(Crossovers.G1DListCrossoverCutCrossfill) genome.evaluator.set(queens_eval) ga = GSimpleGA.GSimpleGA(genome) ga.terminationCriteria.set(GSimpleGA.RawScoreCriteria) ga.setMinimax(Consts.minimaxType["maximize"]) ga.setPopulationSize(100) ga.setGenerations(5000) ga.setMutationRate(0.02) ga.setCrossoverRate(1.0) # This DBAdapter is to create graphs later, it'll store statistics in # a SQLite db file sqlite_adapter = DBAdapters.DBSQLite(identify="queens") ga.setDBAdapter(sqlite_adapter) ga.evolve(freq_stats=10) best = ga.bestIndividual() print best print "\nBest individual score: %.2f\n" % (best.score,) if __name__ == "__main__": run_main()

It tooks 49 generations to solve a 64×64 (4.096 chess squares) chessboard, here is the output:

创0(0.00%):最大/最小/平均健身(原始)20.83(27.00)/13.63(7.00)/17.36(17.36)]创10(0.20%):最大/最小/平均健身(RAW)[55.10(50.00)/39.35(43.00)/45.92(45.92)]创20(0.40%):最大/最小/平均健身(原始)52.51(55.00)/28.37(24.00)/43.76(43.76)]代30(0.60%):最大/最小/平均健身(原始)67.45(62.00)/51.92(54.00)/56.21(56.21)]创40(0.80%):最大/最小/平均健身(原始)65.50(62.00)/19.89(31.00)/54.58(54.58)]进化停止的终止条件的功能!创49(0.98%):最大/最小/平均健身(原始)69.67(64.00)/54.03(56.00)/58.06(58.06)]的总时间经过:39.141秒。

And here is the plots generated by the Graph Plot Tool of Pyevolve:

图。1

图三

fig5

fig8

Genetic Programming meets Python

我很自豪地宣布,Pyevolve的新版本将有Genetic Programmingsupport; after some time fighting with these evil syntax trees, I think I have a very easy and flexible implementation of GP in Python. I was tired to see people giving up and trying to learn how to implement a simple GP using the hermetic libraries for C/C++ and Java (unfortunatelly I’m a Java web developer hehe).

The implementation is still under some tests and optimization, but it’s working nice, here is some details about it:

The implementation has been done inpure Python, so we still have many bonus from this, but unfortunatelly we lost some performance.

该GP的核心是非常非常灵活,因亚洲金博宝为它Compiles the GP Trees in Python bytecodesto speed the execution of the function. So, you can use even Python objects as terminals, or any possible Python expression. Any Python function can be used too, and you can use all power of Python to create those functions, which will be automatic detected by the framework using the name prefix =)

正如你可以在源代码中看到,呼吁个人的语法树,你简单的使用“,当你不需要绑定变量getCompiledCode”要执行它返回的Python编译函数准备方法。

Here is a source-code example:

从进口pyevolve *进口数学error_accum = Util.ErrorAccumulator()#这是所使用的GP核心,#Pyevolve会自动检测到它们#的功能和它们的数量DEF gp_add(A,B)的参数:返回A + B DEFgp_sub(a, b): return a-b def gp_mul(a, b): return a*b def gp_sqrt(a): return math.sqrt(abs(a)) def eval_func(chromosome): global error_accum error_accum.reset() code_comp = chromosome.getCompiledCode() for a in xrange(0, 5): for b in xrange(0, 5): # The eval will execute a pre-compiled syntax tree # as a Python expression, and will automatically use # the "a" and "b" variables (the terminals defined) evaluated = eval(code_comp) target = math.sqrt((a*a)+(b*b)) error_accum += (target, evaluated) return error_accum.getRMSE() def main_run(): genome = GTree.GTreeGP() genome.setParams(max_depth=5, method="ramped") genome.evaluator.set(eval_func) ga = GSimpleGA.GSimpleGA(genome) # This method will catch and use every function that # begins with "gp", but you can also add them manually. # The terminals are Python variables, you can use the # ephemeral random consts too, using ephemeral:random.randint(0,2) # for example. ga.setParams(gp_terminals = ['a', 'b'], gp_function_prefix = "gp") # You can even use a function call as terminal, like "func()" # and Pyevolve will use the result of the call as terminal ga.setMinimax(Consts.minimaxType["minimize"]) ga.setGenerations(1000) ga.setMutationRate(0.08) ga.setCrossoverRate(1.0) ga.setPopulationSize(2000) ga.evolve(freq_stats=5) print ga.bestIndividual() if __name__ == "__main__": main_run()

我很高兴亚洲金博宝和测试在Python这个GP实施的可能性。

And of course, everything in Pyevolve can be visualized any time you want (click to enlarge):

ramped_small

ramped_big

可视化是非常灵活的也一样,如果你使用Pyt亚洲金博宝hon装饰器来设置的功能将如何图形表示的,你可以有许多有趣的可视化模式。如果我改变功能“gp_add”到:

@ GTree.gpdec(表示= “+”,颜色= “红”)DEF gp_add(A,B):返回A + B

我们会得到后续的可视化(点击放大):

full

我希望你喜欢它,我目前正在修复了一些bug,实现新的功能,文档和准备Pyevolve的下一个版本,这将需要一些时间尚未=)

数字考古揭示使用遗传算法恐龙详情

从the article of LiveScience.com:

在和铲子可以顶多在挖掘恐龙的详细信息。现在,超级计算机揭露其解剖,否则失去了历史知识。

(…)

例如,如果肌肉连接到的大腿骨Tyrannosaurus rex较短,那就表明它在人类垂直角度。但是,如果他们是很长的,它可能是水平角度为鸟亚洲金博宝类。

dino

初步尝试随机破译其中的肌肉激活的模式效果最好的结果几乎总是在动物落在它的脸上,解释计算机古生物学家彼得Falkingham在曼彻斯特大学。但科学家们采用“遗传算法”,或Computer programs that can alter themselves and evolve, and so run pattern after pattern until they get improvements.

最终,它们进化肌肉激活的具有稳定步态和恐龙可以步行,奔跑,追逐或吃草的模式,Falkingham说。假设自然选择进化的最佳解决方案,以及时,模拟动物应该移动相似,其现在已经灭绝的对应。事实上,他们已经取得了类似的最高速度和步态与人类,鸸鹋电脑版本和鸵鸟的现实。

Read the全文