E D R S I H C RSS
ID
Password
Join
์—ญ์‚ฌ๋Š” ๋˜ํ’€์ด๋œ๋‹ค. ์ด๋Š” ์—ญ์‚ฌ๊ฐ€ ์ž˜๋ชป๋œ ์ด์œ ์˜ ํ•˜๋‚˜. โ€•C.D.

๏ปฟ * ์›๋ฌธ๋งํฌ : [http]http://www.geneticprogramming.com/Tutorial/index.html

Contents

1 ์‹œ์ž‘
2 ์ ์‘ ํ•จ์ˆ˜(Fitness Function)
3 Gun Firing Program
4 Water Sprinkler System
5 Maze Solving Program
6 Functions and Terminals
7 Crossover Operation
8 Mutation
9 Summary
10 REFERENCES

1 ์‹œ์ž‘ #

์œ ์ „ ํ”„๋กœ๊ทธ๋ž˜๋ฐ(Genetic programming)์€ ์œ ์ „ ์•Œ๊ณ ๋ฆฌ์ฆ˜(genetic algorithm)์˜ ํ•œ ๊ฐˆ๋ž˜์ด๋‹ค. ์œ ์ „ ํ”„๋กœ๊ทธ๋ž˜๋ฐ๊ณผ ์œ ์ „ ์•Œ๊ณ ๋ฆฌ์ฆ˜์˜ ์‚ฌ์ด์˜ ์ฃผ๋œ ์ฐจ์ด์ ์€ ์†”๋ฃจ์…˜์˜ ํ‘œํ˜„๋ฒ•์ด๋‹ค. ์œ ์ „ ํ”„๋กœ๊ทธ๋ž˜๋ฐ์€ ์†”๋ฃจ์…˜์œผ๋กœ์„œ lisp ๋˜๋Š” scheme ์ปดํ“จํ„ฐ ์–ธ์–ด์—์„œ ์ปดํ“จํ„ฐ ํ”„๋กœ๊ทธ๋žจ๋“ค์„ ์ƒ์„ฑํ•˜์ง€๋งŒ, ์œ ์ „ ์•Œ๊ณ ๋ฆฌ์ฆ˜์€ ์†”๋ฃจ์…˜์„ ํ‘œํ˜„ํ•˜๊ธฐ ์œ„ํ•ด ์ˆซ์ž๋“ค์˜ ๋ฌธ์ž์—ด์„ ์ƒ์„ฑํ•œ๋‹ค. ์œ ์ „ ํ”„๋กœ๊ทธ๋ž˜๋ฐ์€ ๋ฌธ์ œ๋“ค์„ ํ•ด๊ฒฐํ•˜๊ธฐ์œ„ํ•ด ๋‹ค์Œ ๋„ค ๋‹จ๊ณ„๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค:

  1. Generate an initial population of random compositions of the functions and terminals of the problem (computer programs).
  2. Execute each program in the population and assign it a fitness value according to how well it solves the problem.
  3. Create a new population of computer programs.
    1. Copy the best existing programs
    2. Create new computer programs by mutation.
    3. Create new computer programs by crossover(sexual reproduction).
  4. The best computer program that appeared in any generation, the best-so-far solution, is designated as the result of genetic programming Koza 1992.

flowchart.gif

2 ์ ์‘ ํ•จ์ˆ˜(Fitness Function) #

์œ ์ „ ํ”„๋กœ๊ทธ๋ž˜๋ฐ์˜ ๊ฐ€์žฅ ์–ด๋ ค์šด ๊ฒƒ๊ณผ ๊ฐ€์žฅ ์ค‘์š”ํ•œ ๊ฐœ๋…์€ "์ ์‘ ํ•จ์ˆ˜" ์ด๋‹ค. ์ ์‘ ํ•จ์ˆ˜๋Š” ์–ผ๋งˆ๋‚˜ ์ž˜ ํ”„๋กœ๊ทธ๋žจ์ด ๊ทธ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ๋Š”์ง€๋ฅผ ๊ฒฐ์ •ํ•œ๋‹ค. ๊ทธ๊ฒƒ์€ ํ”„๋กœ๊ทธ๋žจ์˜ ํ•œ ์œ ํ˜•์—์„œ ๋‹ค์Œ๊นŒ์ง€ ๋Œ€๋‹จํžˆ ๋‹ค์–‘ํ•˜๋‹ค. ์˜ˆ๋ฅผ ๋“ค๋ฉด, ์‹œ๊ณ„์˜ ์‹œ๊ฐ„์„ ์„ค์ •ํ•˜๊ธฐ ์œ„ํ•ด ์œ ์ „ ํ”„๋กœ๊ทธ๋žจ์„ ์ƒ์„ฑํ•˜๋Š” ๊ฒƒ์ด๋ผ๋ฉด, ์ ์‘ ํ•จ์ˆ˜๋Š” ๋‹จ์ˆœํžˆ ๊ทธ ์‹œ๊ณ„๊ฐ€ ์–ด๋А์ •๋„ ์‹œ์‚ฐ์ด ํ‹€๋ ธ๋Š”๊ฐ€๋ฅผ ๋‚˜ํƒ€๋‚ด๊ฒŒ ๋  ๊ฒƒ์ด๋‹ค. ๋ถˆํ–‰ํ•˜๊ฒŒ๋„, ๊ทธ๋Ÿฐ ์‰ฌ์šด ์ ์‘ ํ•จ์ˆ˜๋ฅผ ๊ฐ€์ง„ "๋ฌธ์ œ"๋Š” ๊ฑฐ์˜ ์—†๋‹ค. ๋Œ€๋ถ€๋ถ„์˜ ๊ฒฝ์šฐ์—๋Š” ์ ์‘ ์š”์†Œ๋“ค์„ ์ฐพ์„ ๋ชฉ์ ์œผ๋กœ "๋ฌธ์ œ"์˜ ์•ฝ๊ฐ„์˜ ์ˆ˜์ •์„ ํ•„์š”๋กœํ•œ๋‹ค.

3 Gun Firing Program #

A more complicated example consists of training a genetic program to fire a gun to hit a moving target. The fitness function is the distance that the bullet is off from the target. The program has to learn to take into account a number of variables, such as wind velocity, type of gun used, distance to the target, height of the target, velocity and acceleration of the target. This problem represents the type of problem for which genetic programs are best. It is a simple fitness function with a large number of variables.

4 Water Sprinkler System #

Consider a program to control the flow of water through a system of water sprinklers. The fitness function is the correct amount of water evenly distributed over the surface. Unfortunately, there is no one variable encompassing this measurement. Thus, the problem must be modified to find a numerical fitness. One possible solution is placing water-collecting measuring devices at certain intervals on the surface. The fitness could then be the standard deviation in water level from all the measuring devices. Another possible fitness measure could be the difference between the lowest measured water level and the ideal amount of water; however, this number would not account in any way the water marks at other measuring devices, which may not be at the ideal mark.

5 Maze Solving Program #

If one were to create a program to find the solution to a maze, first, the program would have to be trained with several known mazes. The ideal solution from the start to finish of the maze would be described by a path of dots. The fitness in this case would be the number of dots the program is able to find. In order to prevent the program from wandering around the maze too long, a time limit is implemented along with the fitness function.

6 Functions and Terminals #

The terminal and function sets are also important components of genetic programming. The terminal and function sets are the alphabet of the programs to be made. The terminal set consists of the variables and constants of the programs. In the maze example, the terminal set would contain three commands: forward, right and left. The function set consists of the functions of the program. In the maze example the function set would contain: If "dot" then do x else do y. In the gun firing program is the terminal set would be composed of the different variables of the problem. Some of these variables could be the velocities and accelerations of the gun, the bullet and target. The functions are several mathematical functions, such as addition, subtraction, division, multiplication and other more complex functions.

7 Crossover Operation #

Two primary operations exist for modifying structures in genetic programming. The most important one is the crossover operation. In the crossover operation, two solutions are sexually combined to form two new solutions or offspring. The parents are chosen from the population by a function of the fitness of the solutions. Three methods exist for selecting the solutions for the crossover operation.

The first method uses probability based on the fitness of the solution. If
f1.gif
is the fitness of the solution Si and

f2.gif

is the total sum of all the members of the population, then the probability that the solution Si will be copied to the next generation is Koza 1992:

f3.gif

Another method for selecting the solution to be copied is tournament selection. Typically the genetic program chooses two solutions random. The solution with the higher fitness will win. This method simulates biological mating patterns in which, two members of the same sex compete to mate with a third one of a different sex. Finally, the third method is done by rank. In rank selection, selection is based on the rank, (not the numerical value) of the fitness values of the solutions of the population Koza 1992.

The creation of the offsprings from the crossover operation is accomplish by deleting the crossover fragment of the first parent and then inserting the crossover fragment of the second parent. The second offspring is produced in a symmetric manner. For example consider the two S-expressions in Figure 2, written in a modified scheme programming language and represented in a tree.

cross1.gif

Figure 2: Crossover operation for genetic programming. The bold selections on both parents are swapped to create the offspring or children. (The child on the right is the parse tree representation for the quadratic equation.)

cross2.gif

Figure 3: This figure illustrates one of the main advantages of genetic programming over genetic algorithms. In genetic programming identical parents can yield different offspring, while in genetic algorithms identical parents would yield identical offspring. The bold selections indicate the subtrees to be swapped.

An important improvement that genetic programming displays over genetic algorithms is its ability to create two new solutions from the same solution. In the Figure 3 the same parent is used twice to create two new children.

8 Mutation #

Mutation is another important feature of genetic programming. Two types of mutations are possible. In the first kind a function can only replace a function or a terminal can only replace a terminal. In the second kind an entire subtree can replace another subtree. Figure 4 explains the concept of mutation:

mutation.gif

Figure 4: Two different types of mutations. The top parse tree is the original agent. The bottom left parse tree illustrates a mutation of a single terminal (2) for another single terminal (a). It also illustrates a mutation of a single function (-) for another single function (+). The parse tree on the bottom right illustrates a the replacement of a subtree by another subtree.

9 Summary #

Genetic programming is much more powerful than genetic algorithms. The output of the genetic algorithm is a quantity, while the output of the genetic programming is a another computer program. In essence, this is the beginning of computer programs that program themselves.

Genetic programming works best for several types of problems. The first type is where there is no ideal solution, (for example, a program that drives a car). There is no one solution to driving a car. Some solutions drive safely at the expense of time, while others drive fast at a high safety risk. Therefore, driving a car consists of making compromises of speed versus safety, as well as many other variables. In this case genetic programming will find a solution that attempts to compromise and be the most efficient solution from a large list of variables.

Furthermore, genetic programming is useful in finding solutions where the variables are constantly changing. In the previous car example, the program will find one solution for a smooth concrete highway, while it will find a totally different solution for a rough unpaved road.

10 REFERENCES #

  • Koza, John R. 1992. Genetic Programming: On the Programming of Computers by Means of Natural Selection. Cambridge, MA: The MIT Press.
  • Cramer, Nichael Lynn: "A Representation for the Adaptive Generation of Simple Sequential Programs", Proceedings, International Conference on Genetic Algorithms and their Applications, July 1985 CMU, pp183-187.

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2010-10-28 12:42:52
Processing time 0.5048 sec