research

Primjena genetskih algoritama u generiranju računalnog koda

Abstract

U ovom radu prezentirana je primjena genetskog programiranja, tehnike koja koristi genetski algoritam za generiranje računalnog koda. Definirani su osnovni pojmovi i principi te je dana implementacija u programskom jeziku Haskell. Demonstriran je način na koji se postiže specijacija, odnosno stvaranje novih vrsta, tako da se konstruira stablo u kojem svaki čvor predstavlja novu vrstu koja je evoluirana odvojeno od ostalih. Zatim se te nezavisne vrste križaju pa njihov produkt nastavlja evoluirati. Takva strategija je podložna paralelizaciji te je opisana distribuirana implementacija koja se može izvršavati na više računala koristeći RabbitMQ[4] tehnologiju. Definiran je jezik regularnih izraza kojima se opisuju uzorci u tekstu. Dana je njihova implementacija u Haskellu te je opisano kako se na sintaksnim stablima regularnih izraza provode križanja i mutiranje. Zatim je postavljen problem prepoznavanja pripada li neka riječ engleskom ili njemačkom jeziku. Na osnovu 300 primjera jednog i drugog jezika genetski algoritam evoluira izraz koji prihvaća najveći broj engleskih riječi i što manji broj njemačkih. Konačni produkt postiže 75% točnost na primjerima za trening i 71% točnost na sveukupnom korpusu od 400000 riječi[1][3]. Korisnost tako generiranog izraza demonstrirana je na prepoznavanju jezika u cijelim rečenicama gdje je postignuta približno 85% točnost, te na prepoznavanju izmišljenih riječi.In this work we presented an application of genetic programming, a technique which uses genetics algorithms to generate computer code. We defined basic terms and principles and provided an implementation in the programming language Haskell. We demonstrated a way to achieve speciation, the creation of new species, by constructing a tree in which each node represents a new species evolved separate form others. Then those independent species are crossed and their product continues evolving. This strategy allows for paralelization so we describe a distributed implementation which can be ran on multiple computers via the RabbitMQ[4] technology. We define the language of regular expressions which are used to describe patterns in text. An implementation is given in Haskell and it is described how crossing and mutation is done on regular expression syntax trees. Then we pose the problem of classifying words as either English or German. Given 300 examples of each language the algorithm evolves an expression that accepts as many English words as possible while rejecting as many German. The final product achieves the accuracy of 75% on the training sample and 71% on the whole corpus of 400000 words [1][3]. The utility of such an expression is demonstrated in recognizing the language of whole sentences where we achieve approximately 85% accuracy, and on recognizing made-up words

    Similar works