• Aucun résultat trouvé

Evolutionary Programming

Dans le document Clever Algorithms (Page 132-138)

Evolutionary Algorithms

3.6 Evolutionary Programming

Evolutionary Programming, EP.

3.6.1 Taxonomy

Evolutionary Programming is a Global Optimization algorithm and is an instance of an Evolutionary Algorithm from the field of Evolutionary Computation. The approach is a sibling of other Evolutionary Algorithms such as the Genetic Algorithm (Section3.2), and Learning Classifier Systems (Section 3.9). It is sometimes confused with Genetic Programming given the similarity in name (Section3.3), and more recently it shows a strong functional similarity to Evolution Strategies (Section3.4).

3.6.2 Inspiration

Evolutionary Programming is inspired by the theory of evolution by means of natural selection. Specifically, the technique is inspired by macro-level or the species-level process of evolution (phenotype, hereditary, variation) and is not concerned with the genetic mechanisms of evolution (genome, chromosomes, genes, alleles).

3.6.3 Metaphor

A population of a species reproduce, creating progeny with small pheno-typical variation. The progeny and the parents compete based on their suitability to the environment, where the generally more fit members con-stitute the subsequent generation and are provided with the opportunity to reproduce themselves. This process repeats, improving the adaptive fit between the species and the environment.

3.6.4 Strategy

The objective of the Evolutionary Programming algorithm is to maximize the suitability of a collection of candidate solutions in the context of an objective function from the domain. This objective is pursued by using an adaptive model with surrogates for the processes of evolution, specifically hereditary (reproduction with variation) under competition. The representation used for candidate solutions is directly assessable by a cost or objective function from the domain.

3.6.5 Procedure

Algorithm3.6.1provides a pseudocode listing of the Evolutionary Program-ming algorithm for minimizing a cost function.

3.6. Evolutionary Programming 121 Algorithm 3.6.1: Pseudocode for Evolutionary Programming.

Input: P opulationsize, ProblemSize, BoutSize Output: Sbest

Population←InitializePopulation(P opulationsize,ProblemSize);

1

EvaluatePopulation(Population);

2

Sbest ←GetBestSolution(Population);

3

while¬StopCondition()do

4

Children← ∅;

5

foreachP arenti ∈Populationdo

6

Sbest ←GetBestSolution(Children,Sbest);

11

Union←Population+Children;

12

foreachSi ∈ Uniondo

13

for1 toBoutSizedo

14

Sj ←RandomSelection(Union);

15

Population←SelectBestByWins(Union,P opulationsize);

21

ˆ The representation for candidate solutions should be domain specific, such as real numbers for continuous function optimization.

ˆ The sample size (bout size) for tournament selection during competi-tion is commonly between 5% and 10% of the populacompeti-tion size.

ˆ Evolutionary Programming traditionally only uses the mutation opera-tor to create new candidate solutions from existing candidate solutions.

The crossover operator that is used in some other Evolutionary Algo-rithms is not employed in Evolutionary Programming.

ˆ Evolutionary Programming is concerned with the linkage between par-ent and child candidate solutions and is not concerned with surrogates for genetic mechanisms.

ˆ Continuous function optimization is a popular application for the approach, where real-valued representations are used with a Gaussian-based mutation operator.

ˆ The mutation-specific parameters used in the application of the algo-rithm to continuous function optimization can be adapted in concert with the candidate solutions [4].

3.6.7 Code Listing

Listing3.5provides an example of the Evolutionary Programming algorithm implemented in the Ruby Programming Language. The demonstration problem is an instance of a continuous function optimization that seeks minf(x) wheref =Pn

i=1x2i, −5.0≤xi ≤ 5.0 and n = 2. The optimal solution for this basin function is (v0, . . . , vn1) = 0.0. The algorithm is an implementation of Evolutionary Programming based on the classical implementation for continuous function optimization by Fogel et al. [4] with per-variable adaptive variance based on Fogel’s description for a self-adaptive variation on page 160 of his 1995 book [3].

1 def objective_function(vector)

2 return vector.inject(0.0) {|sum, x| sum + (x ** 2.0)}

3 end

4

5 def random_vector(minmax)

6 return Array.new(minmax.size) do |i|

7 minmax[i][0] + ((minmax[i][1] - minmax[i][0]) * rand())

8 end

9 end

10

11 def random_gaussian(mean=0.0, stdev=1.0)

12 u1 = u2 = w = 0

22 def mutate(candidate, search_space)

23 child = {:vector=>[], :strategy=>[]}

24 candidate[:vector].each_with_index do |v_old, i|

25 s_old = candidate[:strategy][i]

26 v = v_old + s_old * random_gaussian()

27 v = search_space[i][0] if v < search_space[i][0]

28 v = search_space[i][1] if v > search_space[i][1]

29 child[:vector] << v

30 child[:strategy] << s_old + random_gaussian() * s_old.abs**0.5

31 end

32 return child

3.6. Evolutionary Programming 123

33 end

34

35 def tournament(candidate, population, bout_size)

36 candidate[:wins] = 0

37 bout_size.times do |i|

38 other = population[rand(population.size)]

39 candidate[:wins] += 1 if candidate[:fitness] < other[:fitness]

40 end

41 end

42

43 def init_population(minmax, pop_size)

44 strategy = Array.new(minmax.size) do |i|

45 [0, (minmax[i][1]-minmax[i][0]) * 0.05]

46 end

47 pop = Array.new(pop_size, {})

48 pop.each_index do |i|

49 pop[i][:vector] = random_vector(minmax)

50 pop[i][:strategy] = random_vector(strategy)

51 end

52 pop.each{|c| c[:fitness] = objective_function(c[:vector])}

53 return pop

54 end

55

56 def search(max_gens, search_space, pop_size, bout_size)

57 population = init_population(search_space, pop_size)

58 population.each{|c| c[:fitness] = objective_function(c[:vector])}

59 best = population.sort{|x,y| x[:fitness] <=> y[:fitness]}.first

60 max_gens.times do |gen|

61 children = Array.new(pop_size) {|i| mutate(population[i], search_space)}

62 children.each{|c| c[:fitness] = objective_function(c[:vector])}

63 children.sort!{|x,y| x[:fitness] <=> y[:fitness]}

64 best = children.first if children.first[:fitness] < best[:fitness]

65 union = children+population

66 union.each{|c| tournament(c, union, bout_size)}

67 union.sort!{|x,y| y[:wins] <=> x[:wins]}

68 population = union.first(pop_size)

69 puts " > gen #{gen}, fitness=#{best[:fitness]}"

70 end

71 return best

72 end

73

74 if __FILE__ == $0

75 # problem configuration

76 problem_size = 2

77 search_space = Array.new(problem_size) {|i| [-5, +5]}

78 # algorithm configuration

79 max_gens = 200

80 pop_size = 100

81 bout_size = 5

82 # execute the algorithm

83 best = search(max_gens, search_space, pop_size, bout_size)

84 puts "done! Solution: f=#{best[:fitness]}, s=#{best[:vector].inspect}"

85 end

Listing 3.5: Evolutionary Programming in Ruby

3.6.8 References

Primary Sources

Evolutionary Programming was developed by Lawrence Fogel, outlined in early papers (such as [5]) and later became the focus of his PhD dissertation [6]. Fogel focused on the use of an evolutionary process for the development of control systems using Finite State Machine (FSM) representations. Fogel’s early work on Evolutionary Programming culminated in a book (co-authored with Owens and Walsh) that elaborated the approach, focusing on the evolution of state machines for the prediction of symbols in time series data [9].

Learn More

The field of Evolutionary Programming lay relatively dormant for 30 years until it was revived by Fogel’s son, David. Early works considered the application of Evolutionary Programming to control systems [11], and later function optimization (system identification) culminating in a book on the approach [1], and David Fogel’s PhD dissertation [2]. Lawrence Fogel collaborated in the revival of the technique, including reviews [7,8]

and extensions on what became the focus of the approach on function optimization [4].

Yao et al. provide a seminal study of Evolutionary Programming propos-ing an extension and racpropos-ing it against the classical approach on a large number of test problems [12]. Finally, Porto provides an excellent contem-porary overview of the field and the technique [10].

3.6.9 Bibliography

[1] D. B. Fogel. System Identification Through Simulated Evolution: A Machine Learning Approach to Modeling. Needham Heights, 1991.

[2] D. B. Fogel. Evolving artificial intelligence. PhD thesis, University of California, San Diego, CA, USA, 1992.

[3] D. B. Fogel. Evolutionary computation: Toward a new philosophy of machine intelligence. IEEE Press, 1995.

[4] D. B. Fogel, L. J. Fogel, and J. W. Atmar. Meta-evolutionary pro-gramming. InProceedings 25th Asilomar Conf. Signals, Systems, and Computers, pages 540–545, 1991.

[5] L. J. Fogel. Autonomous automata. Industrial Research, 4:14–19, 1962.

[6] L. J. Fogel. On the Organization of Intellect. PhD thesis, UCLA, 1964.

3.6. Evolutionary Programming 125 [7] L. J. Fogel. The future of evolutionary programming. InProceedings

of the Conference on Signals, Systems and Computers, 1990.

[8] L. J. Fogel. Computational Intelligence: Imitating Life, chapter Evo-lutionary Programming in Perspective: the Top-down View, pages 135–146. IEEE Press, 1994.

[9] L. J. Fogel, A. J. Owens, and M. J. Walsh. Artificial Intelligence Through Simulated Evolution. Wiley, 1966.

[10] V. W. Porto. Evolutionary Computation 1: Basic Algorithms and Operations, chapter 10: Evolutionary Programming, pages 89–102. IoP Press, 2000.

[11] A. V. Sebald and D. B. Fogel. Design of SLAYR neural networks using evolutionary programming. InProceedings of the 24th Asilomar Conference on Signals, Systems and Computers, pages 1020–1024, 1990.

[12] X. Yao, Y. Liu, and G. Lin. Evolutionary programming made faster.

IEEE Transactions on Evolutionary Computation, 3(2):82–102, 1999.

Dans le document Clever Algorithms (Page 132-138)