1 / 26

Spring 2011 Artificial Intelligence COSC 40503 week 12

Spring 2011 Artificial Intelligence COSC 40503 week 12. Antonio Sanchez Texas Christian University. References www.cs.vu.nl /~gusz/ecbook/slides/Genetic_Algorithms.ppt web.umr.edu/~ercal/387/slides/GATutorial. ppt igda-phx.org/resources/20031121_ga. ppt

hieu
Télécharger la présentation

Spring 2011 Artificial Intelligence COSC 40503 week 12

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Spring 2011Artificial Intelligence COSC 40503week 12 Antonio Sanchez Texas Christian University References www.cs.vu.nl/~gusz/ecbook/slides/Genetic_Algorithms.ppt web.umr.edu/~ercal/387/slides/GATutorial.ppt igda-phx.org/resources/20031121_ga.ppt parasol.tamu.edu/~amato/Courses/ 689-608/presentations/jkp2866/gep-jack.ppt www.niss.org/affiliates/proteomics200303/ presentations20030306/04%20Jennifer.ppt http://www.eece.unm.edu/~akbazar/

  2. Definition Genetic From Greek genno γεννώ= give birth) Algorithm From Farsi, belonging to the a prominent Muslim mathematician AlKhowarizmi (790-840). Advocates of the new math system were called algorists as opposed to the abacists who continued to use the abacus inherited from the Romans. The first use of the word Algorithm is from Liebnitz in the late 1600 referring to a method of solving problems my means of sequence of procedures that loops and branches depending on what's coming up for them thereby optimizing their chances of having a productive experience. .

  3. History: The lighter side of it So. What happened here ?????

  4. History • 1859 Charles Darwin publishes The Origin of Species • 1865 Gregor Mendel publishes paper Experiments on Plant Hybridization • 1905 William Bateson coins the term "genetics" in a letter to Adam Sedgwick • 1910 Thomas Hunt Morgan shows that genes reside on chromosomes • 1953 James Watson and Francis Crick with RosalindFranklin resolved structure DNA as a double helix Artificial GA’s • 1975 John Holland publishes Adaptation in Natural and Artificial Systems • 1989 David Goldberg publishes Genetic Algorithms in Search, Optimization and Machine Learning,

  5. Ga’s Detailed History • 1948 Turing proposed the search by means evolutionary or genetics • 1962 Bremermann proposed optimization through recombination and evolution • 1964 Rechenberg introduced the concepts of evolution strategies • 1965 Fogel, Owens and Walsh introduced evolutionary programing • 1975 J. Holland the recognized father of GA • 1989 D. Goldberg big promoter of the use of GA for search and learning • 1992 Koza introduces genetic programming

  6. Genetic algorithms • GA represent a practical and no sweat approach to finding a solution by letting the machine try different solutions in time until we get a good approximation to the best solution. • It is based on the belief that a solution is always comprised by a set of elements and just recombining the elements will get us there. • Very much the way nature does it.

  7. Genetic Algorithms represent a practical and no sweat approach to finding a solution by letting the machine try different solutions in time until we get a good approximation to the best solution.It is based on the belief that a solution is always comprised by a set of elements and just recombining these elements will get us there.Very much the way nature does it. O p t i m i z a t i o n ! well not quite, just quasi These are the issues we deal with in GA’s or Genetic Algorithms, the third approach of AI

  8. The Simple book of GA’s • Determine the task to evaluate • Codify the Chromosome and number of genes • Define the initial population • Criteria of selection by the environment • Random selection of survivors • Chromosome crossing • Mutation • Evolution The knapsack optimization

  9. The Simple book of GA’s • Determine the task to evaluate • Optimization function definition (clear and unsolved) • Value computation • Example: Provide Optimal values for the function F(x,y) = 21.5 + xSIN(4πx) + ySIN(20πy) In the ranges of -3 < x < 12.1 and 4.1 < y < 5.8 Source: Michalewicz  Z. Genetic Algorithms  Springer Verlag 1992

  10. The Simple book of GA’s 2. Codify the Chromosome and number of genes • It depends on the desired precision more bits = > more precision and the scalable and mapping functions • Define evolution parameters • Population size • Number of crossings • Probability of crossing • Location of the crossing • Substitution policy • Mutation probability • Number of generations, time or Stop criteria

  11. The Simple book of GA’s 3. Example • 18 bits for x and 15 bits for y (0101010010101010100,111000110101010) value = Initial + dec(Gene) * range / (2^GeneBits -1) x = -3 + DEC(genes(0,17)*15.1/2^18 -1) y = 4.1 + DEC(genes(18,32)*1.7/(2^15 -1) 2. Define evolution parameters • Population size 20 genes • Number of crossings Chromosomes/2 • Probability of crossing px = 1.0 • Location of the crossing One crossing anywhere • Substitution policy Population is added with no substitution • Mutation probability pc = 0.0001 • Number of generations, time or stop criteria Ngen = 50 Source: Michalewicz  Z. Genetic Algorithms  Springer Verlag 1992

  12. The Simple book of GA’s • Define the initial population • Random process • Example Chromosome 0 : (101010010101010101,111000110101010) Chromosome 1 : (001111111110100101,111111110001101) ….. Chromosome 18 : (001010010111111010,111000110111111) Chromosome 19 : (011111010100101011,111000000001101)

  13. The Simple book of GA’s 4. Criteria of selection by the environment 1. Success Criteria 2. Optionally Diversity Criteria 3. Value computation 4. Example In this case just select the top 4 genes or chromosomes F(x,y) for f(chr 0) = 17.95678 F(x,y) for f(chr 1) = 12.25645 F(x,y) for f(chr 2) = 27.954478 F(x,y) for f(chr 3) = 20.2295678

  14. The Simple book of GA’s 5. Random selection of survivors • Accumulative distribution • Random intervention to the distribution • Population size maintenance • Example F(population) = f(c0)+ f(c1) + f(c2) + f(c3) = Chromosome Yields:c0 = f(c0)/F(pop), c1 = f(c1)/F(pop),cn = f(cn)/F(pop) With random intervention generate a population from these selected chromosomes Eliminate the other genes of the population

  15. The Simple book of GA’s 6. Chromosome recombination(crossover) • Number of crossover per generation • Random selection of probability of crossover • Random selection of crossover bit • Random selection of genes to mate • Crossing • Substitution (or addition) into the population • Example • Number of crossover per generation Chromosome/2 • Probability of crossover if RAND > Th then Crossover • Random selection of crossover bit RAND in the bit range • Random selection of genes to mate 2 RAND in the range of gene population size • Crossover swap bits between genes • Substitution (or addition) into the population

  16. The Simple book of GA’s • Mutation 1. Random selection of mutation probability 2. Random selection of mutant gene 3. Random selection of mutation bit 4. Example 1. Random selection of mutation probability if RAND > Th then mutation 2. Random selection of mutant gene RAND in the gene population range 3. Random selection of mutation bit RAND in the bit range

  17. The Simple book of GA’s • Evolution if generation = Limit of generations (or any other stop criteria ) then Do step 4 and End Simulation else Do repeat steps 4,5,6,7 y 8

  18. GA’s for Minimax • Determine the task to evaluate The Evaluation Function ef = ∑ciFpi= c1F1p1 +c2F2p2 for all i In the ranges of -rmin < ci < rmxy pmin < pi < pmx Code the doefficients of the function as parts of a chromosome Play the game and determine the best genes Cross the genes and so on …..

  19. Examples // four in a row ef = ∑ciFpi=progwin*1000000 + progblockwin*100000 + progwinoption*1000 + progconnect*100 + progopencount*10 + progcolumnworth*2 - clswin*10000 – clsblockwin*1000 – clswinoption*100 - clsconnect*10 - clsopencount*5 - clscolumnworth*2 // mankala ef = ∑ciFpi=15DK + 5DG + 20Dt + 2Dl + 3Ds // matches ef = ∑ciFpi = (A%2 + B%2 + C%2 + D%2 + E%2)%2 * 100 - 50 ef = ∑ciFpi = (((((A^B)^C)^D)^E)) – 10 and also the value of ß

  20. GA’s in minimax 3. Example • If ∑ = Cr R + Cn N + Ca A + Cv V then: [01001,11111,01101,11101] Value Ci = rmin + DEC[genes(0,4)*range/2^5 -1] ……… Value Ci = rmin + DEC[genes(0,4)*range/2^5 -1] 2.Define evolution parameters • Population size 20 genes • Number of crossings Chromosomes/2 • Probability of crossing px = 1.0 • Location of the crossing One crossing anywhere • Substitution policy Population is added with no substitution • Mutation probability pc = 0.0001 • Number of generations, time or stop criteria Ngen = 50

  21. GA’s in minimax • Define the initial population • Random process • Example Chromosome 1 : (01010100101010101010) Chromosome 2 : (01110101101110100010) .......... Chromosome 19 : (11101101101110101111) Chromosome20 : (10010111101110100110)

  22. GA’s in minimax 4. Criteria of selection by the environment 1. Play the game against each chromosome using an trained stm or other evaluation function for 100 games and detemine the number of wins 2. Select the top 4 winners and determine winning ratio F(x,y) for f(chr 0) = 27/100 F(x,y) for f(chr 1) = 22/100 F(x,y) for f(chr 2) =18/100 F(x,y) for f(chr 3) =16/100

  23. GA’s in minimax 5. Random selection of survivors Using the previous example F(population) = f(c0)+ f(c1) + f(c2) + f(c3) = 83 games won Chromosome Yields:c0 = f(c0)/F(pop) = 27/83 = 32% c1 = f(c1)/F(pop) = 22/83 = 27% c2 = f(c2)/F(pop) = 18/83 = 22% c3 = f(c3)/F(pop) = 16/83 = 19% With random intervention generate a population from these selected chromosomes until I have 20. Note that they will repeat according to their yield and the random intervention Eliminate the other genes of the population

  24. GA’s in minimax 6. Chromosome Recombination • Number of crossover per generation 20/2 = 10 • Probability of crossover if RAND > Threshold then Cross • Random selection of crossover bit RAND in the bit range • let say it was on bit 14 • Random selection of genes to mate 2 RAND in the range of gene population size 6. Crossing swap bits between genes 6. c5 (01110101101110,100010) -----> (01110101101110,101110) c17(10111101100010,101110) ----> (10111101100010,100010) 7. Substitution into the population

  25. GA’s in minimax • Mutation 1. Random selection of mutation probability if RAND = 0.999 > Th = 0.995 then mutation 2. Random selection of mutant gene RAND = 15 in the gene population range 3. Random selection of mutation bit RAND = 8 Then c15 (10111101100010101110) == > (10111101000010101110)

  26. Evolution in minimax functions • Evolution Since generation 20 <= Limit = 50 of generations Do repeat steps 4,5,6,7 y 8 NOTE It is very important to tabulate and graph the values of the perfomance of both the best in the generation and the generation as as whole to determine the quasi optimization pattern Generation performance Best in the generation

More Related