Grammatical Evolution : Evolving Programs for an Arbitrary Language - PowerPoint PPT Presentation

1 / 28
About This Presentation
Title:

Grammatical Evolution : Evolving Programs for an Arbitrary Language

Description:

expressing the grammar of a language. in the form of production rules. ... but unfortunate or misguided choice could harm the evolution. Problems of GADS 2 ... – PowerPoint PPT presentation

Number of Views:186
Avg rating:3.0/5.0
Slides: 29
Provided by: scSn
Category:

less

Transcript and Presenter's Notes

Title: Grammatical Evolution : Evolving Programs for an Arbitrary Language


1
Grammatical Evolution Evolving Programs for an
Arbitrary Language
  • C.Ryan, JJ Collins, M.O.NeillPresentation by
    Taeyoung Jeong

2
Contents
  • Backus Naur Form(BNF)
  • Genetic Algorithm for Developing Software (GADS)
  • Problems of GADS
  • Review of GA
  • Grammatical Evolution(GE)
  • Examples

3
Backus Naur Form(BNF)
  • Notation forexpressing the grammar of a language
    in the form of production rules.
  • Consists of terminals T, non-terminals N,
    starting symbol S, production rule P.

4
BNF Example
  • Nexpr,op,pre_op,varTsin,cos,tan,log,,-,,/,
    (,),XSltexprgt
  • ltexprgtltexprgtltopgtltexprgt ( ltexprgt )
    ltpre_opgt ( ltexprgt ) ltvargt
  • ltopgt , -, , /
  • ltvargt X
  • ltpre_opgtsin cos tan log

5
Genetic Algorithm for Developing Software (GADS)
  • Described in Evolving Caching Algorithms in C by
    GP by N.Paterson
  • Uses linear chromosome, and each gene means an
    production rule applied.

6
GADS by Example
  • ltexprgtltexprgtltopgtltexprgt 0 ( ltexprgt ) 1
    ltpre_opgt ( ltexprgt ) 2 ltvargt 3
  • ltopgt , -, , / 4,5,6,7
  • ltvargt X 8
  • ltpre_opgtsin cos 9,10 tan
    log 11,12 13 rules

7
GADS Example continued
  • Gene 156, 42, 112, 199, 250, 21 becomes 0, 3,
    8, 4, 3, 8 (by modular 13)
  • ltexprgt ltexprgt ltopgt ltexprgt 0 ltvargt ltopgt
    ltexprgt 3 X ltopgt ltexprgt 8 X
    ltexprgt 4 X ltvargt 3 X X 8

8
Problems of GADS 1
  • After resolving chromosome, what if the
    non-terminal exists?ltexprgtltexprgtltopgtltexprgt....
    . XXXXXltopgtltexprgt applies default
    rule, like ltopgt, but unfortunate or misguided
    choice could harm the evolution.

9
Problems of GADS 2
  • There are several dont care symbols, that is,
    the rules that cannot be applied.
  • S ltexprgt ?--- ltvgtx (?)
    ltexprgt ?--- ltegtltegtltogtltegt ltexprgtltopgtltexprgt
    ?- ltogt (?) ltexprgtltopgtltexprgt

10
Dramatic Error Fair?
  • ltvgtXltegtltegtltogtltegtltegtltvgtltvgtXltogtltegtltvgtltv
    gtX
  • S gt XX
  • ltegtltvgtltegtltegtltogtltegtltegtltvgtltvgtXltogtltegtltvgt
    ltvgtX
  • S gt ltvgtby default rule, SX
  • Dont care symbols mean nothing, but still
    important for resolving(?)

11
Review of GA Representation
  • Path representation chromosome describes the
    sequence
  • ex) 3?1?4?7?5?2?6 (for TSP, or Job
    Processing)- only the relative position matters.

12
Review of GA Representation
  • Ordinal representation chromosome describes the
    number of position for each element.
  • ex) 2, 6, 1, 3, 5, 7, 4 (12nd,26th,31st,43rd,
    55th,67th,74th) (for TSP, or Job
    Processing)- The gene and its place are both
    matters.

13
Concept Protein Model
  • What if, each gene means the rules actually
    applied? The position of each gene has
    meaning.
  • What if, each gene can have a meaning for any
    choice of rules? No dont care symbol.

14
Concept Protein Model
  • A protein can be used in several cells or organs,
    but the use of it can be different place to
    place.(fat can be in the brain, in the
    stomach...)
  • A gene can be placed in several places in
    chromosome, but the use of it can be different
    place to place.

15
Grammatical Evolution(GE) Example
  • If the first unresolved non-terminal symbol is
    ltexprgt, the gene means one of the following
    rules.ltexprgtltexprgtltopgtltexprgt 0 ( ltexprgt
    ) 1 ltpre_opgt ( ltexprgt ) 2 ltvargt 3

16
GE example contd.
  • ltopgt , -, , / for 0,1,2,3
  • ltpre_opgtsin,cos,tan,log for 0,1,2,3
  • ltvargt X is trivial no genes needed

17
GE example contd.
  • We got gene 156, 42, 112, 199, 250, 21
  • Sltexprgt gene 1560(mod 4) ltegtltegtltogtltegt
  • Sltegtltogtltegt gene 422(mod 4) ltegtltpgt(ltegt)
  • Sltpgt(ltegt)ltogtltegt gene 1122(mod 4) ltpgttan
  • Stan(ltegt)ltogtltegt gene 1993(mod 4) ltegtltvgtX

18
GE example contd.
  • We got gene 156, 42, 112, 199, 250, 21
  • Stan(X)ltogtltegt gene 2502(mod 4) ltogt
  • Stan(X)ltegt gene 211(mod 4) ltegt(ltegt)
  • Stan(X)(ltegt) .....huh?

19
What if we got non-terminal?
  • Resolve it by default rules(same error!)
  • Consider the gene invalid, putting HARD
    penalties on it.
  • Reuse the genes read the genes again, and
    resolve it until it finishes. (or hits TO)Each
    gene generates the same protein, but the effect
    of that protein can be different, depending on
    where it is.

20
GE in GA view
  • In schema theorem, the shorter the schema is,
    the more possible it can alive while crossover.
  • GE makes the chromosome more simple and short,
    decreasing the distance between the product
    rules. ? easy to survive!

21
Operator Duplicate()
  • Making a copy of a gene or genes.
  • New gene can be placed next to the original gene,
    or the very different place.
  • AOOOOOO if we duplicate O (eeoe, eO,
    o)AOOOOOOO

22
Operator Prune() Introns
23
Operator Prune()
  • Too many introns GE dont necessarily use all
    the genesex) XXX uses 5 genes only
  • Introns are also participate in crossover and
    mutation, and blocks the useful genes to be
    changed.
  • Prune() is applied with a probability to any
    individuals, making it discard all its introns.

24
Example Interpolation Problem
25
Example Interpolation Problem
26
Wrapper
27
Results
  • GE consistently discovered target function when
    both duplicate(), prune() employed.
  • Tend to fixate on curve operators as sin(),
    exp(), as these gene rated a curve similar to the
    target function.
  • Space constraint matters.
  • Biasing individuals can help to find a shorter,
    effective solution.

28
Conclusion
  • GE has similar structures and aims to those of
    GP.
  • GE has closer biological analogies to the nature
    than GP.
  • Using BNF notation, GE can be used in multi-line
    function.
Write a Comment
User Comments (0)
About PowerShow.com