Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Introduction to genetic programming and PyEvolve.

Genetic programming is new approach to solving problems that are hard to define. It is based on Darwin's theory of evolu
by

Michał Jastrzębski

on 18 October 2012

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Introduction to genetic programming and PyEvolve.

Genetic programming in python Basic concepts Blame this guy -> Survival the fittest Evolve and profit 1. Population 2. Fitness function Programs as trees Functions and variables 3. Breeding 1. Declare a fitness function x^2 + 3*x - 30 2. Create population 3. Crossover PyEvolve http://pyevolve.sourceforge.net/ def eval_func(chromosome):
score = 0.0
for index, value in enumerate(chromosome):
correct = (index^2) + (3*index) + 30
score += abs(correct - value)
return score genome = G1DList.G1DList(10)
genome.evaluator.set(eval_func)
genome.initializator.set(Initializators.G1DListInitializatorInteger)
genome.mutator.set(Mutators.G1DListMutatorIntegerRange) ga = GSimpleGA.GSimpleGA(genome)
ga.setGenerations(1000)
ga.setMinimax(Consts.minimaxType["minimize"])
ga.evolve(freq_stats=10)

print ga.bestIndividual() Evolving antenna Evolisa http://www.youtube.com/watch?v=JBgG_VSP7f8&feature=rellist&playnext=1&list=PL74A5F0D944575FED ? Michał Jastrzębski
inc007@gmail.com http://prezi.com/79cqrqg5hk22/introduction-to-genetic-programming-and-pyevolve/ http://pyevolve.sourceforge.net Evolving data structures [44, 35, 33, 50, 73, 58, 39, 33, 98, 76]
[33, 35, 36, 50, 42, 47, 42, 53, 72, 68]
[28, 35, 36, 36, 44, 47, 49, 56, 68, 68]
[28, 35, 36, 36, 47, 53, 49, 56, 64, 68]
[33, 35, 36, 40, 48, 53, 51, 56, 64, 68]
[33, 35, 36, 40, 48, 53, 51, 56, 64, 68]
[33, 35, 36, 40, 48, 53, 51, 56, 64, 68]
[1, 1, 2, 3, 5, 8] [1, 1, 2, 5, 10, 8] [8, 4, 3, 3, 5, 7] def gp_add(a, b): return a+b
def gp_sub(a, b): return a-b
def gp_mul(a, b): return a*b
def gp_power(a, b): return a^b
def eval_func(chromosome):
global error_accum
error_accum.reset()
code_comp = chromosome.getCompiledCode()
for x in xrange(0, 30):
correct = (x^2) + (3*x) + 5
score = eval(code_comp)
error_accum += (correct, score)
return error_accum.getRMSE() genome = GTree.GTreeGP()
genome.setParams(max_depth=5, method="ramped")
genome.evaluator.set(eval_func)
ga = GSimpleGA.GSimpleGA(genome)
ga.setParams(gp_terminals= ["x"] + [str(a) for a in range(6)],\
gp_function_prefix = "gp")
ga.setMinimax(Consts.minimaxType["minimize"])
ga.setGenerations(1000)
ga.setMutationRate(0.08)
ga.setCrossoverRate(1.0)
ga.setPopulationSize(1000)
ga.evolve(freq_stats=5)
print ga.bestIndividual() gp_add(
gp_add(x,
gp_add(gp_add(x, x),
gp_power(2, x))),
gp_power(5,
gp_mul(
gp_mul(
gp_mul(0, x),
gp_add(x, 5)),
gp_mul(gp_add(x, x),
gp_mul(0, 5)))))
Full transcript