Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 8625 High Performance Computing Dr. Hoganson Copyright © 2003, Dr. Ken Hoganson 7-13-05- CS8625 Class Will Start Momentarily… CS8625 High Performance.

Similar presentations


Presentation on theme: "CS 8625 High Performance Computing Dr. Hoganson Copyright © 2003, Dr. Ken Hoganson 7-13-05- CS8625 Class Will Start Momentarily… CS8625 High Performance."— Presentation transcript:

1 CS 8625 High Performance Computing Dr. Hoganson Copyright © 2003, Dr. Ken Hoganson 7-13-05- CS8625 Class Will Start Momentarily… CS8625 High Performance and Parallel Computing Dr. Ken Hoganson Genetic algorithms

2 CS 8625 High Performance Computing Dr. Hoganson Copyright © 2003, Dr. Ken Hoganson Genetic Programming Concept: For problems with very large number of possible solutions, and no direct computational mechanism to obtain solution, genetic programming can be used to search for a solution. Example problem: Maximize f(w,x,y,x)= -w 2 +100w-x 2 -40x-y 2 +80y-z 2 -200z For values (w,x,y,z) from [–4999  +5000] How many possible solutions? 10,000 values for each variable 4 variables  10,000 4 = (10 4 ) 4 =10 16 10,000,000,000,000,000 possible combinations to search!

3 CS 8625 High Performance Computing Dr. Hoganson Copyright © 2003, Dr. Ken Hoganson Genetic Algorithm 10,000,000,000,000,000 possible combinations to search! Say 10gigahertz machine Assume 1 operation per cycle Each operation takes 1/10billionth of a second 1/10,000,000,000 = 1/10 10 = 10 -10 second Assume evaluating the function takes 100 operations (10 2 ) One evaluation takes 10 2 * 10 -10 = 10 -8 seconds 100,000,000 (10 8 )evaluations per second 10 16 / 10 8 = 10 8 seconds = 100,000,000 seconds (31,536,000 seconds in a year) 3 years to check every solution!

4 CS 8625 High Performance Computing Dr. Hoganson Copyright © 2003, Dr. Ken Hoganson Rather than check every combination of variables by evaluating function for that combination, Use genetic algorithm instead. SubSet of (random) initial combinations of w,x,y,z Combine the subset wxyz-combinations in a way that favors the solution interested in (crossover). (natural selection favors reproduction of the most “fit” parents, producing more “fit” offspring) Repeat for multiple generations, which should tend toward an optimal solution. Can also allow for random mutations (the random subset of wxyz combinations may include values close to the optimal)

5 CS 8625 High Performance Computing Dr. Hoganson Copyright © 2003, Dr. Ken Hoganson Implementation Values for w,x,y,z: lets restrict to values from –4095 to +4096 two’s complement or sign-magnitude in 13 bits So, have 4 variables of 13 bits each = 52 bits total Crossover: children are combinations of variables from two parents, ie a child of A and B could have w from A, x from B, y from A, z from B

6 CS 8625 High Performance Computing Dr. Hoganson Copyright © 2003, Dr. Ken Hoganson Implemenation Start with 64 random combinations of (w,x,y,z) Organized in 8 subsets of 8 combinations Each iteration, the best 4 (w,x,y,z) in each set combine with a best (w,x,y,z) from other sets to produce: A new “generation” of 64 children The “worst’ 4 (w,x,y,z) in each set do not reproduce, and ‘die’ and are eliminated from the subset, and replaced by offspring from the successful and reproducing combinations. The reproducing parents are also eliminated, replaced by the “new offspring”

7 CS 8625 High Performance Computing Dr. Hoganson Copyright © 2003, Dr. Ken Hoganson Implementation To allow for random mutations: In each iteration, allow random mutations, which we will model as a bit “flip” (reversal, complementation) Eight mutations per generation offspring (8 out of the new 64 child combinations of w,x,y,z)

8 CS 8625 High Performance Computing Dr. Hoganson Copyright © 2003, Dr. Ken Hoganson Design guidance Just a command line kind of interface, but show something of the changing w,x,y,z each generation as they converge toward the maximum. Use Java threads, one per subset (8 threads) to do the evaluations of the best combinations, and exchange “DNA” with other threads.

9 CS 8625 High Performance Computing Dr. Hoganson Copyright © 2003, Dr. Ken Hoganson Convergence? What is the solution? This example chosen because we can find a solution. Example problem: Maximize f(w,x,y,x)= -w 2 +100w-x 2 -40x-y 2 +80y-z 2 -200z For values (w,x,y,z) from [–4999  +5000] Algebra – completing the square for each variable yields: 14500-(w-50) 2 -(x+20) 2 -(y-40) 2 -(z+100) 2 Since all squared terms subtract from the 14500, the maximum is where each variable term is zero: W=50, x=-20, y=40, z=-100

10 CS 8625 High Performance Computing Dr. Hoganson Copyright © 2003, Dr. Ken Hoganson Final Exam Project This project will be your final exam! Turn in: –a description of your software design –source code –and your experimental results from running your algorithm. Due date not set, but probably first day of finals. Class time will be given for this project. Perhaps only a couple more lectures this semester.

11 CS 8625 High Performance Computing Dr. Hoganson Copyright © 2003, Dr. Ken Hoganson End of Lecture End Of Today’s Lecture.


Download ppt "CS 8625 High Performance Computing Dr. Hoganson Copyright © 2003, Dr. Ken Hoganson 7-13-05- CS8625 Class Will Start Momentarily… CS8625 High Performance."

Similar presentations


Ads by Google