Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Prudce inteligentní talk o umělé inteligenci

Prudce inteligentní talk o umělé inteligenci

Talk pro PyVo, 30. června 2016

- úvod do AI
- počítání podle přírody aneb biocomputing

Michal Wiglasz

June 30, 2016
Tweet

More Decks by Michal Wiglasz

Other Decks in Science

Transcript

  1. Let‘s google a definition: An area of computer science that

    deals with giving machines the ability to seem like they have human intelligence. Simulation of human intelligence processes by machines.
  2. „We must go deeper.“ My move My move Opponents move

    These are final states with my score -1 0 1 Opponents move
  3. These are final states with my score „There and back

    again“ (algorithms min-max, alfa-beta…) -1 1 1 1 1 -1 -1 My move towards MAX score My move towards MAX score Opponents move towards MIN score -1 0 1 Opponents move towards MIN score 1 0 0 0 0 -1 -1 1 1
  4. Classification: ML method which assigns classes to inputs Supervised learning

    Ok, computer, this is an „A“: Ok, computer, this is a „C“: Ok, computer, this is an „L“: Ok, human, I‘ll learn that! Input here: 40×40 (1600) binary values
  5. Ok, computer, what is this? Hey, human, this is an

    „A“. Ok, computer, what is this? Hey, human, this is an „L“. Ok, computer, what is this? Hey, human, this is an „A“. Hey, human, not sure. „A“?
  6. 1. Initialize the population 2. Pick the strongest ones 3.

    Make children, eliminate the weak ones 4. Repeat
  7. Pick proper problem encoding! Chromosome (genotype) for graph coloring: Node

    1 2 3 4 5 6 7 8 9 Color red red blue green red yellow blue green green
  8. Fitness function: how good/bad is the individual In graph coloring:

    number of edges connecting nodes with the same color
  9. Mom: Dad: Baby: Mutated baby Node 1 2 3 4

    5 6 7 8 9 Color red red blue green red yellow blue green green Node 1 2 3 4 5 6 7 8 9 Color blue green red yellow yellow yellow red red green Node 1 2 3 4 5 6 7 8 9 Color red red blue green red yellow red red green Node 1 2 3 4 5 6 7 8 9 Color red blue blue green red yellow red red green
  10. import random COLORS = ["red", "green", "blue", "yellow"] INDIVIDUALS =

    10 NODES = 9 TARGET_FITNESS = 0 make_individual = lambda: [random.choice(COLORS) for _ in range(NODES)] population = [make_individual() for _ in range(INDIVIDUALS)] new_population = [None for _ in range(INDIVIDUALS)] generation = 0 while True: fitnesses = map(fitness_func, population) if max(fitnesses) == TARGET_FITNESS: break for i in range(INDIVIDUALS): mom, dad = pick_parents(population) split_point = random.randint(0, NODES - 1) new_population[i] = mutate(mom[:split_point] + dad[split_point:]) population = new_population generation += 1
  11. 57