* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download A Niched Cartesian Genetic Programming for Evolvable Hardware
Polymorphism (biology) wikipedia , lookup
Genetic code wikipedia , lookup
Pharmacogenomics wikipedia , lookup
Medical genetics wikipedia , lookup
Dual inheritance theory wikipedia , lookup
Behavioural genetics wikipedia , lookup
Designer baby wikipedia , lookup
Heritability of IQ wikipedia , lookup
History of genetic engineering wikipedia , lookup
Genetic drift wikipedia , lookup
Genetic engineering wikipedia , lookup
Public health genomics wikipedia , lookup
Human genetic variation wikipedia , lookup
Genetic testing wikipedia , lookup
Genetic engineering in science fiction wikipedia , lookup
Genome (book) wikipedia , lookup
Koinophilia wikipedia , lookup
Population genetics wikipedia , lookup
Rev. Téc. Ing. Univ. Zulia. Vol. 39, Nº 3, 37 - 43, 2016 doi:10.21311/001.39.3.6 A Niched Cartesian Genetic Programming for Evolvable Hardware Fuchuan Ni1, 2*, Yuanxiang Li1 , Xiaoyan Yang1, Jinhai Xiang2 State Key Lab of Software Engineering, Wuhan 430072, Hubei, China 2 College of Informatics, Huazhong Agricultural University, Wuhan 430070, Hubei,China *Corresponding author(E-mail: [email protected]) 1 Abstract Evolvable hardware (EHW) adapts its structure and functionality at run time, by evolutionary algorithms, in a dynamic and uncertain environment. Because of man-for-one genotype-phenotype map in EHW, the problems of evolving digital circuit are multi-modal optimizations. As an important algorithm for EHW, Cartesian Genetic Programming suffers from a premature convergence caused by the genetic drift. The genetic diversity in a population decreases quickly and it loses an exploration capability. To maintain the diversity of the population and search for all the global solutions, niched techniques are tailored into traditional Cartesian Genetic Programming (NCGP). The results of the compared experiments on benchmark circuits demonstrate that the niched Cartesian Genetic Programming can maintain the diversity of the evolving population, avoiding premature and is more likelyto find all the global solutions. Key words: Evolvable Hardware, Cartesian Genetic Programming, Multi-modal Optimization, Niched Technique. 1. INTRODUCTION Evolvable hardware (EHW), is an adaptive hardware system (AHS) to dynamically alter the hardware functionality and structure of its circuits using technics inspired by natural evolution (X. Yao and T. Higuchi, 1999). The circuit structure and parameters are reconfigurable by the control of evolutionary algorithms (EAs) on the flexible hardware substrate. These techniques began to be treated with increasing interest in the mid1990s when Garis introduced the concept of EHW (Garis, 1997). Eiben A E and Jim Smith deem that evolutionary algorithms pave the way: from software to hardware, going from digital evolutionary systems to physical ones (Eiben and Jim2015). In the beginning, the binary bitstreams, is the simplest form of evolvable hardware. But scalability is the issue when large designs are considered. To search efficiently and effectively, many representations for EAs were researched, such as genetic programming (GP) (Koza,1992), evolution strategy (ES) (Bäck and Hoffmeister, 1991), grammatical evolution (GE) (Ryan and Collins,1998), evolutionary programming (EP) (Fogel and Owens, 1996), Cartesian Genetic Programming (CGP) (Miller and Thomson,1999), adaptive GA (AGA) (Ko and Kang, 1997), parallel GA (PGA) (Alba and Tomassini,2002), compact GA (Harik and Lobo,1999), traceless genetic programming (Oltean,2004), multi expression programming (Oltean,2004), gene expression programming (Yan and Wei, 2006), and so on . Genetic programming (GP), gene expression programming (GEP) and multi expression programming (MEP) are tree-representations algorithms; Cartesian Genetic Programming uses directed acyclic graphs to represent the digital circuits and programs. Among these algorithms, CGP is the most popular, important algorithm for evolvable digital circuits. Cartesian Genetic Programming (CGP), uses evolution strategy (ES), operating with the population of (μ+λ) individuals by point mutation. Like other forms of evolutionary algorithms, CGP is easily to fall into local optimal point, and is difficult to find all the global optimal solution for multi-modal problems. Niching methods are effective to maintain the population diversity and reduce the losses that result from genetic drift. (Goldberg and Richardson, 1987) proposed Genetic algorithms with sharing for multimodal function optimization. (Manner and Mahfoud, 1994)utilized crowding to preserve multimodal diversity. (Hwang and Cho, 2009) uses the speciation technique to enable diverse circuits to evolve efficiently by the process of one-step evolution. However, the speciation techniques in (Hwang and Cho, 2009) woks on bitstreams representation based on the simplified GAL chips with only one OLMC. The techniques can not apply in EHW based on FPGA directly. This paper proposes a concise niched technique for Cartesian Genetic Programming algorithm to evolve the digital circuits. The proposed techniques are useful for fault tolerant application, evolvable robotics. This paper is organized as follows. Section 2 considers the principle of EHW, Cartesian genetic programming and the many-for-one mapping problems in EHW. Section 3 proposes a sharing niched technique and tailors the technique into CGP to maintain the diversity and the ability of searing all the global solutions for evolving combinational circuit. Sections 4 present the simulation results with the 3-bit adder circuit. The 37 Rev. Téc. Ing. Univ. Zulia. Vol. 39, Nº 3, 37 - 43, 2016 experiments are conducted by comparing the conventional CGP and the Niched CGP. Finally, section 5 presents the main conclusions. 2. CARTESIAN GENETIC PROGRAMMING Based on Programmable Logic Devices (PLDs) or reconfigurable devices, the configure strings, are evolved, selected and evaluated in an adapt process controlled by EAs. The principle schema of an EHW is illustrated in Figure 1. Inititial Chromosome New Chromosome 0111000101001110101 Evolve 1011010101001110101 Select I0 I1 Reconfigurable device Evolve 1011010101001110101 Select I0 I1 Evaluate I2 Evolved Chromosome ... ... I2 EA Process I0 I1 Evaluate I2 EA Process Reconfigurable device Reconfigurable device Figure 1. Principal schema of an EHW. 2.1.The Cartesian genetic programming Cartesian genetic programming (CGP), as a linear genetic programming, was proposed by J.F. Miller et al in 1997. CGP uses directed acyclic graphs to represent programs, rather than the more familiar representation of programs as trees. This is loosely inspired by the architecture of digital circuits called FPGAs (field programmable gate arrays). The original CGP was represented by a two-dimension matrix of nodes. There are functional nodes and output nodes in CGP. Each functional node consists of connecting genes and functional gene and the output nodes is composed of connecting gene. In a feed-forward manner, nodes take their inputs from either a program input or output of the previous nodes in the matrix. Nodes in the same columns cannot be connected to each other. The chromosome is linearly sequenced. The genotype of CGP has a fixed length. CGP has an important trait of non-boat. CGP does not suffer from genotype growth and phenotypic growth (Miller and Smith, 2006).The genotype is a list of integers that represent the program primitives and genetic encoding is compact, simple and easy to implement. CGP can handle multiple outputs easily (Miller and Thomson,2000). To detail CGP, the one-bit adder is exemplified, as it is shown in Fig. 2 and Fig. 3. Fig 2 is the genotype representation of the one-bit adder and Fig. 3 is the one-bit adder circuit decoded from the genotype. The chromosome is arranged as : 2 0 1, 0 1 3,1 0 3 ,4 2 1,0 1 1,2 4 3,2 8 1,6 7 2,3 1 0 ,10,8 .The Length of the genotype is 3 ×3 ×3 +2=29. B 0 1 3 0 A 3 4 1 C 2 5 4 1 6 9 10 Cout 2 0 1 7 6 2 10 3 8 S 8 7 1 2 11 4 Figure 2. the genotype representation in CGP A B Cout C S Figure 3.one-bit adder circuit decoded 38 Rev. Téc. Ing. Univ. Zulia. Vol. 39, Nº 3, 37 - 43, 2016 The genotype-decoded process begins form the output nodes by checking which nodes is connected to the output nodes. Then these nodes are examined to find out which nodes required recursively. Refer to Fig.2, the output node Cout is addressed by 10; then move to 10. Node 10 connects to node 6 ,7 and move to node 6 and node 7. Node 7 connects to the program input 0 and 1; Node 6 connects to node 4 and the program input 2. Then move to node 4 which connects to the program input 0 and 1. Therefor output node Cout is decoded. The output node S is decoded in the same manner. The nodes decoded are active nodes. According to the function look-up table, the final circuit is decoded as Fig. 3. When the genotype is decoded, some nodes may be not used in the calculation of output data. These nodes are non-coding nodes. In Fig.2 nodes 3, 5, 9, 11 are not decoded and they are inactive. These inactive genes have a neutral effect on genotype fitness. This phenomenon is “neutrality”. (Miller and Smith, 2006) argued that the influence of neutrality beneficial to the efficiency of the evolutionary process on a range of benchmarks. The genotype-evaluated process compares the output to the desired program outputs, and calculates the fitness of the genotype fi for a single input data item. In digital-circuit evolution the usual number of fitness cases is no2ni (here no is number of output, n i is number of input). CGP evolutionary algorithm is a form of evolutionary strategy using small populations and elitism. A simple (μ+λ) evolutionary algorithm is widely used for CGP. The traditional Cartesian Genetic Programming is shown in the following procedure (Miller,2011). The (μ+λ) Cartesian Genetic Programming (μ=1,λ= 4) for all i such that 0 ≤ i < 5 do Randomly generate individual i end for Select the fittest individual, which is chosen as the parent while a solution is not found or the generation limit is not reached do for all i such that 0 ≤ i < 4 do Mutate the parent to generate new individual end for Select the fittest individual according to the following rules: If the new individual is no worse than the parent then the new individual is promoted as the fittnest else The parent chromosome remains the fittest end if end while The Mutation operator in traditional CGP is point mutation, which works by randomly choosing a valid allele at a randomly chosen gene location. When offspring genotypes in the population have the same fitness as the parent and there is no offspring better than the parent, an offspring is chosen as the fittnest. (Yu and Miller 2001; 2002) argued that both the simple operator and the simple evolutionary strategy are so effective is related to the presence of non-coding genes. Also the CGP algorithm navigates the search space using neutral drift. There is a different opinion. (Hu and Joshua, 2012) demonstrated that the benefits of neutrality are problem-dependent and that the relationships between robustness, evolvability, and accessibility vary amongst the genotypic, phenotypic, and fitness spaces of linear GP. 2.2 The genotype-phenotype Map The genotype-phenotype Map in EHW is a Many-for-one Map. It lies in three ways. First of all, a logic circuit could be described with many logic expressions. Even the simple logic expression, could be represented as "multiply of sum” or "sum of multiply". There is many-for-one map between physical logic circuits and the formal description. Secondly, there is a Map between genotype and phenotype in CGP chromosome representations. Many chromosomes would map into only one circuit that has the same functionality, i.e. the same physical logic circuit has many encoding representations. CGP does not guarantee similarity of hardware structures resulting in similarity of fitness. Finally, as mentioned above, because neutral drift results that the mutational offspring are not necessarily phenotypically different from parents, fitness evaluations may be wasteful. (Hwang and Cho, 2009)studied the landscape of the half-adder contained in the EHW. They calculated the ruggedness of the fitness landscape by using the auto-correlation function and found complicated spaces contain many peaks that can lead to deceptions when using the evolving process. This means it is very difficult to search for the optimal points. In CGP, the individuals that have the greater fitness have greater possibilities to reproduce. Thus, in the later stage in evolving process, the difference between the individuals becomes little and “stalling effect" 39 Rev. Téc. Ing. Univ. Zulia. Vol. 39, Nº 3, 37 - 43, 2016 appears. CGP, as other evolutionary algorithms, also suffers from a premature convergence problem caused by the genetic drift. The genetic diversity in a population decreases quickly and it loses an exploration capability. Due to the Many-for-one Map, CGP has many local optimal solutions and the problems solved by EHW have the limitations in scalability (Vassilev and Miller, 2000; Gordon and Bentley,2005; Haddow and Tyrrell,2011). (Ni and Li, 2014) proposed an orthogonal genetic operator to improve the CGP. More scalable ways to search the solution space for more complex EHW applications must be explored. Niched techniques increase the increase the diversity of population in evolutionary algorithms and maintain diverse solutions in a multimodal optimization problem with high dimension. 3.THE NICHED CARTESIAN GENETIC PROGRAMMING Because the solution space grows exponentially with the increasing number of inputs and the outputs (assuming that an output decided by all possible input combinations) and many for one genotypes- phenotype map, The problem of EHW is a multimodal optimization .The simple evolutionary strategy (ES) often traps into local optima ,or Stalling. It is difficult to find the global optimal solution, not to mention all local optimal extreme value points. To improve the efficiency of CGP for the multi-modal problems in EHW, niched techniques are tailored to be a niched Cartesian Genetic Programming. They maintain diverse solutions by punishing overpopulated solutions or discarding similar one. The distance measuring is an essential part of the algorithms because they use the closeness of solutions to decide to whether give a penalty or discard one. 3.1 The fitness sharing niched elimination strategy To maintain the diversity of the population, a fitness sharing niched method is adopted to eliminate the similar chromosomes. Similarity is Hamming distance on genotype or Euclidean distance on phonotype. In this paper, hamming distance di on genotype is utilized to measure the Similarity between the ith chromosome and the parent chromosome, here i, 0<i<Max_Popsize i≠parent. If di < Min_Len, let Fitness[i] =PENALTY, here Fitness[i] is the fitness of the ith chromosome, PENALTY is a litter constant number, Min_Len is a parameter predefined. The Niched elimination for all i such that 0 ≤ i < 5 do if( i == the parent) continue; d= 0; for all gene j that 0 ≤ j < geneNumber do d = d + distance( the jth gene of individual , the jth gene of the parent); end for if d < Min_Len then Fitness[i] =PENALTY; end for 3.2 The Niched Cartesian Genetic Programming (NCGP) A simple evolutionary algorithm known as a 1+λ evolutionary algorithm is widely used for CGP. The niched Cartesian Genetic Programming is shown in the following procedure. The new population is formed from μ best parents and population_size -μ offspring. The μ parents are copied across unchanged, i.e. elitism strategy. In this paper, let μ = 1, λ = 4. The Mutation operator is random point mutation. The best solutions are circuits that match the truth table with the minimal logical gates. The (1+4) Niched Cartesian Genetic Programming for all i such that 0 ≤ i < 5 do Randomly generate individual i end for Select the fittest individual, which is chosen as the parent while a solution is not found or the generation limit is not reached do for all i such that 0 ≤ i < 4 do Mutate the parent to generate new individual end for Niche elimination; Select the fittest individual according to the following rules: If the new individual is no worse than the parent then the new individual is promoted as the fittnest else The parent chromosome remains the fittest end if end while 40 Rev. Téc. Ing. Univ. Zulia. Vol. 39, Nº 3, 37 - 43, 2016 4.RESULTS OF EXPERIMENTS This section shows the implementation of the experiment: Traditional CGP and the Proposed NCGP are compared with 3-bit adder circuit has 6 inputs and 7 outputs. Both algorithms use the (1+λ) evolutionary strategy, which new population is generated from 1 best parent and λ offspring. The parent is copied across unchanged, i.e. elitism strategy. The goal is to find the digital circuits that match the truth table and have the minimal logic gates. This means that the global optimal solutions are the matched digital circuits with the minimal gates, other circuits matched are the local optimal and there are many global optimal solutions. The parameters are set as: evolving generation: 5000000, population: 10, mutation probability: 5%. Table 1.The node operating function types Operation type data[in1] ~data[in1] data[in1] & data[in2] data[in1] | data[in2] data[in1] ^ data[in2] ~(data[in1] & data[in2]) ~(data[in1] | data[in2]) ~(data[in1] ^ data[in2]) Function code 0 1 2 3 4 5 6 7 The digital circuit is showed as : (7)2 5 5, (8)1 4 7,(10)2 5 5,(13)7 1 7, (31)5 7 4,(39)4 0 7,(48)13 8 6,(55)48 39 4,(60)0 55 2,(75)3 55 7,(79)75 55 3,(80)60 79 7,80 75 31 10.Numbers in comma is the identifier of the node. The first two numbers are connective genes and the last number is the function code listed in Table 1.The two algorithms rum 20 times and the solutions are shows in Table 2. In traditional CGP, only 2 times the global optimal solution are found while 15 times are gotten in NCGP. Table 2. The solutions,20 times runs CGP ① 14 ② 16 ③ 16 ④ 13 ⑤ 12 ⑥ 16 ⑦ 21 ⑧ 14 ⑨ 14 ⑩ 17 ⑪ 15 ⑫ 14 ⑬ 16 ⑭ 15 ⑮ 14 ⑯ 13 ⑰ 15 ⑱ 12 ⑲ 17 ⑳ 14 NCGP 13 12 12 12 12 12 12 13 13 12 12 12 12 12 12 13 12 13 12 12 Figure4 (a), (b) show the evolving process of the NCGP and CGP. The vertical coordinate is the fitness and horizontal coordinate is sequence number of the evolving generations. The red curve (annotated with +),is the best fitness in current generation; The green curve (annotated with ×),is the average fitness in current generation. From the curves, the average fitness curve rises and falls sharply in CGP and the average fitness curve in NCGP is non-decreasing. Figure 4 (a ). the convergence curve in NCGP Figure4 (b). the convergence curve in CGP Figure5 (a), (b) show the First Hit Generation when NCGP and CGP finds the first local solutions which match the truth table. The vertical coordinate is the First Hit Generation and horizontal coordinate is sequence number of the run times. CGP convergence faster than NCGP in most runs. But CGP is easy to stalling in the later evolving procedure and cannot always get the global optimal solutions, which match the truth table with 12 logical gates. 41 Rev. Téc. Ing. Univ. Zulia. Vol. 39, Nº 3, 37 - 43, 2016 Figure 8 (a ).the First Hit Generation in NCGP CGP .5. CONCLUSIONS Figure 8 (b).the First Hit Generation in Due to the Many-for-one genotype-phenotype Map, the problems of evolving digital circuits in EHW are multimodal optimization. The classical CGP often falls into local optimal point and fail to find all the global optimal solutions. The proposed NCGP could find all the global optimal solution with the niched technique. The result of the compared experiment on benchmark circuits demonstrates that the niched technique can maintain the diversity of the evolving population, avoiding premature. But how to select the niched radius relies on practical experiences and NCGP convergences slower than CGP for extra distance computing. In the future, a self-adaption niched CGP will be developed. Acknowledgements This work was supported by Project 2662015PY147supported by the Fundamental Research Funds for the Central Universities of China and Natural Science Foundation of China (NO.60442001). REFERENCES X. Yao and T. Higuchi (1999)“Promises and challenges of evolvable hardware”, IEEE Trans. Syst., Man, Cybern. C, Appl. Rev., 29(1),pp. 87-97. H. de Garis (1997)“Evolvable hardware: Principles and practice”, Commun. ACM, 40(8), Aug. 1997. Eiben A E, Jim S (2015)“From evolutionary computation to the evolution of things”. Nature, 2015, 521(7553):476-82. J. R. Koza (1992)“Genetic Programming: On the Programming of Computers by Means of Natural Selection”. Cambridge, MA: MIT Press, 1992. T. Bäck, F. Hoffmeister, and H. P. Schwefel (1991) “A survey of evolutionary strategies”,Proc. 4th Int. Conf. Genetic Algorithms, pp. 2-9. C. Ryan, J. J. Collins, and M. O. Neill (1998)“Grammatical evolution: Evolving programs for an arbitrary language”, Proc. 1st Eur. Workshop Genetic Program, pp. 83-95. L. J. Fogel, A. J. Owens, and M. J. Walsh (1996)“Artificial Intelligence through Simulated Evolution”, New York: Wiley, 1966. J. Miller(1999) “An empirical study of the efficiency of learning Boolean functions using a Cartesian genetic programming approach”, Proc. Genetic Evol. Comput. Conf., pp. 1135-1142. J. F. Miller and P. Thomson(2000)“Cartesian genetic programming”, Proc. EuroGP,pp. 121-132. M.-S. Ko, T.-W. Kang, and C.-S. Hwang(1997)“Function optimisation using an adaptive crossover operator based on locality”, Eng. Appl. Artif. Intell.,10(6), pp. 519-524. E. Alba and M. Tomassini(2002)“Parallelism and evolutionary algorithms”, IEEE Transactions on Evolutionary Computation, 6(5), pp. 443-462. G. Harik, F. Lobo, and D. Goldberg(1999)“The compact genetic algorithm”, IEEE Transactions on Evolutionary Computation., 3(4), pp. 287-297. M. Oltean(2004)“Solving even-parity problems using traceless genetic programming”, Proc. CEC, pp. 18131819. M. Oltean and C. Grosan(2004) “Evolving digital circuits using multi expression programming”, Proc. NASA/DoD Conf. Evolvable Hardware,pp. 87-94. X.S.Yan,Wei Wei(2006)”Design Electronic Circuits by Means of Gene Expression Programming”, Proc. of the First NASA/ESA Conference on Adaptive Hardware and Systems, pp. 194-199. Xuesong Yan, Wei Wei, Qingzhong Liang, Chengyu Hu, Yuan Yao(2007)“Designing Electronic Circuits by Means of Gene Expression Programming II”, Proc. of ICES 2007, pp.319-330 Goldberg D E, Richardson J.(1987)“Genetic algorithms with sharing for multimodal function optimization”, 42 Rev. Téc. Ing. Univ. Zulia. Vol. 39, Nº 3, 37 - 43, 2016 Proc. of International Conference on Genetic Algorithms on Genetic Algorithms & Their Application,pp.41-49. Manner R, Mahfoud S W.(1994)“Crowding and Preselection Revisited”, R.männer & B.manderick Parallel, pp.27-36. Keum-Sung Hwang, Sung-Bae Cho(2009)“Improving evolvable hardware by applying the speciation technique”, Applied Soft Computing 9 (2009) 254–263 Miller,J.F.,Smith,S.L.(2006)“Redundancy and Computational Efficiency in Cartesian Genetic Programming”, IEEE Transactions on Evolutionary Computation, 10(2), 167-174 . Yu, T., Miller, J.F.(2001)“Neutrality and the evolvability of Boolean function landscape”, Proc. European Conference on Genetic Programming, pp. 204217. Yu, T., Miller, J.F.(2002)“Finding Needles in Haystacks is not Hard with Neutrality”, Proc. European Conference on Genetic Programming, pp. 13-25. Hu T, Payne J L, Banzhaf W, et al.(2012)“Evolutionary dynamics on multiple scales: a quantitative analysis of the interplay between genotype, phenotype, and fitness in linear genetic programming”, Genetic Programming & Evolvable Machines, 13(3), pp.305-337. Pauline C. Haddow, Andy M. Tyrrell(2011)“Challenges of evolvable hardware: past, present and the path to a promising future”, Genetic Programming and Evolvable Machines,12(3), pp.183-215. T. G. W. Gordon and P. J. Bentley(2005)“Bias and scalability in evolutionary development”, Proc. Genetic Evol. Comput. Conf., pp. 83-90. V. K. Vassilev and J. F. Miller(2000) “Scalability problems of digital circuit evolution evolvability and efficient designs”, Proc. 2nd NASA/DoD Workshop Evolvable Hardware, pp. 55-64. Ni F, Li Y, Yang X, et al. (2014) “An Orthogonal Cartesian Genetic Programming Algorithm for Evolvable Hardware”, Proc. of International Conference on Identification, Information and Knowledge in the Internet of Things,pp. 220-224. Julian F. Miller, et al.(2011)Cartesian Genetic Programming. Springer-Verlag Berlin Heidelberg 2011. 43