Using Justinian Roscas Subroutine in GP to solve parity problem - PowerPoint PPT Presentation

1 / 29
About This Presentation
Title:

Using Justinian Roscas Subroutine in GP to solve parity problem

Description:

General logic programs evolved using grammars specifically devised to solve ... selection on programs (individuals) that have biggest fitness improvement over ... – PowerPoint PPT presentation

Number of Views:68
Avg rating:3.0/5.0
Slides: 30
Provided by: niti2
Category:

less

Transcript and Presenter's Notes

Title: Using Justinian Roscas Subroutine in GP to solve parity problem


1
Using Justinian Roscas Subroutine in GP to solve
parity problem
  • Nitin Kumar Dahra
  • And
  • Nilesh Mishra
  • March 30, 2004

2
Introduction
3
Introduction
  • Evolutionary Algorithms - An umbrella term used
    to describe computational models which use
    evolution as a key element in their design and
    implementation. Some varieties
  • Genetic Algorithms
  • Evolutionary Programming
  • Evolution Strategies
  • Classifier Systems
  • Genetic Programming
  • source comp.ai.genetic

4
  • They simulate the evolution of individual
    structures from a population via processes of
    selection, crossover and mutation. Each
    individual from the population gets a measure of
    it's fitness in the environment and high fitness
    individuals generally make it to the next
    generation.

5
The problem!
  • The even n-parity problem
  • An even n-parity function of n boolean inputs,
    the task is to evolve a function that returns 1
    if an even number of inputs evaluate to 1, 0
    other wise. We will be using the ARL-GP (Adaptive
    Representation through Learning) algorithm
    proposed by Rosca Ballard (Ref.) to attack this
    problem.

6
Motivation of the problem
  • Even n parity problem is used as a benchmark for
    quantifying GP techniques. And has independently
    received considerable study. Solution evolved
    fall into one of two classes
  • Solutions found by GP's genetic algorithm search
    constructed solely from general logic primitives
    (AND,OR,NOT) and terminals (boolean variables).
  • General logic programs evolved using grammars
    specifically devised to solve parity problem.

7
Solution to 3 Parity Problem
8
Background
9
Genetic Algorithms
  • Population is represented by chromosomes (fixed
    length character strings)
  • Like Base 4 Chromosomes which we have in our DNA
    -
  • A adenine
  • C cytosine
  • G guanine
  • T thymine
  • The individuals in the population goes through
    simulated evolution
  • Special Symbols -
  • K Alphabet Size
  • M Population Size
  • L Length of string
  • G Maximum Generations

10
Example
  • Reproduction (Selection)
  • Strings Fitness After reproduction f(X)
  • 011 3 011 3
  • 001 1 110 6
  • 110 6 110 6
  • 010 2 010 2
  • Total 12 17
  • Worst 1 2
  • Average 3 4.25
  • Best 6 6
  • Darwinian principle at work

11
Crossover
  • Allows new individuals to be created
  • Parent 1 Parent 2
  • 011 110
  • The crossover point is chosen by randomly
    selecting a number between 1 and L-1
  • Crossover fragments
  • Fragment1 Fragment2
  • 01- 11-
  • Remainders
  • Remainder1 Remainder2
  • --1 --0
  • Offsprings
  • Offspring1 Offspring2
  • 111 010

12
Mutation
  • It's an asexual operation in that it operates on
    only one individual.
  • A number is randomly selected from 1 to L as
    mutation point. The single character at this
    point is complemented (if the alphabet is binary)
  • Very sparingly used (It is unimportant in nature
    as well as in genetic algorithms!)
  • The primary use of this operator is to restore
    the lost diversity in a population.

13
Notes
  • The frequencies of these operators are specified
    by the respective probability parameters Pr, Pc,
    and Pm
  • Genetic Algorithm works in a domain-independent
    way on fixed-length character strings in the
    population so it is actually a "weak method". But
    still, in practice genetic algorithms are
    surprisingly rapid in effectively searching
    complex, highly nonlinear, multidimensional
    search spaces.

14
Genetic Programming
  • Extension of the genetic model of learning into
    the space of programs.
  • The objects that constitute the population are
    not fixed-length character strings that encode
    possible solutions to the problem at hand, they
    are programs that, when executed, "are" the
    candidate solutions to the problem. These
    programs are expressed in genetic programming as
    parse trees, rather than as lines of code. Thus,
    for example, the simple program "a b c" would
    be represented as -
  • / \
  • a
  • / \
  • b c
  • Or, to be precise, as suitable data structures
    linked together to achieve this effect. Since
    this is a very natural thing to do in the
    programming language LISP, it is our language of
    choice for this project.

15
S-Expression
  • An example of LISP S-expression (the only
    syntactic form in LISP)
  • ( 1 2 (IF (gt TIME 10) 3 4) )
  • This is polish notation
  • / \
  • 1 2 IF
  • / \
  • gt 3 4
  • / \
  • TIME 10

16
(No Transcript)
17
Reasons for choosing LISP
  • Both programs and data have same form i.e.
    S-expression. So it both possible and convenient
    to treat it as a data when modifying it
    genetically and treating it as program when we
    want to execute the result of genetic
    manipulation.
  • The S-expression (i.e. the program/data) is
    equivalent to the parse tree for the computer
    program. And we need to access/modify this parse
    tree for genetic operations so LISP is a clear
    choice.
  • EVAL function of LISP provides an effortless way
    to execute a program that was just created or
    genetically modified.
  • LISP facilitates the programming of structures
    whose shape and size change dynamically.
  • LISP facilitates convenient handling of
    hierarchical structures.

18
Hierarchical-GP
  • Hierarchical Genetic Programming (HGP)
    extensions discover, modify and exploit
    subroutines to accelerate the evolution of
    programs. The use of subroutines biases the
    search for good programs and offers the
    possibility to reuse code. Problems with generic
    HGP techniques -
  • No use of domain knowledge.
  • No informed choices to automatically decide when
    creation or modification is beneficial.

19
ADF-GP
  • In Automatically Defined Functions (ADF-GP)
    technique individuals are represented by a set of
    subroutines called automatically defined
    functions (ADFs) and a main function called
    results producing branch.
  • The architecture of program is defined by number
    of subroutine, and the nature of hierarchical
    references among the components.
  • The acquisition of subroutines is in line with
    the building block hypothesis in GA/GP that GP
    solutions are refined bottom-up, i.e. by starting
    with small pieces of useful code (partial
    solutions) and then by combining them to compose
    heigher and heigher order components.

20
ADF-GP
  • One disadvantage of ADF is that we need to design
    an appropriate architecture for program i.e. set
    in advance the numbers of subroutines and
    arguments, as well as the nature of subroutines
    and arguments, as well as the nature of
    references among subroutines.

21
ARL-GP
  • Adaptive Representation through Learning (ARL)
    has inbuilt mechanisms for
  • Creation of new subroutines through discovery and
    generalization of blocks of code.
  • Deletion of subroutines.
  • It overcomes the disadvantage of ADF i.e. to
    design an appropriate architecture in advance.

22
ARL-GP
  • The set of evolved subroutines extracts common
    knowledge emerging during the evolutionary
    process and acquires the necessary structure for
    solving the problem. ARL extends the GP engine
    with machinery for adapting the problem
    vocabulary by creating and using new subroutines
    on the fly.

23
ARL-GP
  • The algorithm copes with both the above problems
    by respectively -
  • 1) Relying on local measures such as
    parent-offspring differential fitness and block
    activation in order to discover useful
    subroutines and by learning which subroutines are
    useful.
  • 2) Relying on global population measures such as
    population entropy in order to predict when
    search reaches local optima and escape them.

24
ARL-GP
  • Differential Fitness - The concept of
    differential fitness is a heuristic which focuses
    bloc selection on programs (individuals) that
    have biggest fitness improvement over their least
    fit parent. Here F (i ) is the raw fitness.

25
ARL-GP
  • Block Activation - is defined as the number of
    times the root node of the block is executed. The
    more active blocs become candidate blocks.
  • The complete algorithm is as in Figure

26
Merits of ARL and Why ARL
  • ARL operates on small blocks of code with three
    advantages.
  • small blocks of code are more general,
  • online computation is very efficient,
  • subroutines of any complexity can be generated by
    iterative application over generation.

27
Merits of ARL and Why ARL
  • Programs as structures on which GP operates, are
    symbolically expressed as composition of
    functions.
  • By applying the above heuristics, the ARL
    algorithm manages to discover functions which
    increase the chances of creating better
    solutions.
  • The main advantage of ARL lies in idea that
    subroutines obtained from blocks of good
    representations act as building blocks and may
    enable a faster evolution of even better
    representation.

28
References
29
References
  • Justinian P. Rosca, Dana H. Ballard. Discovery of
    Subroutines in Genetic Programming. Advances in
    Genetic Programming Volume 2
  • Lorenz Huelsbergen. Finding General Solutions to
    the Parity Problem by Evolving Machine-Language
    Representations. Conference on Genetic
    Programming, 1998
  • J. Koza. Genetic Programming On the Programming
    of Computers by Means of Natural Selection. MIT
    Press, Cambridge, MA, 1992.
  • Justinian P. Rosca and Dana H. Ballard. An
    analysis of Hierarchial genetic programming.
    Technical report 566, University of Rochester,
    Rochester, New York. USA. 1995
  • Justinian P. Rosca. Entropy-driven adaptive
    representation. In Rosca, J. P., editor,
    Proceedings of the Workshop on Genetic
    Programming, 1995 From Theory to Real-World
    Applications (NRL TR 95.2, University of
    Rochester), pages 23-32
  • Justinian P. Rosca. Hierarchical Learning with
    Procedural Abstraction Mechanism, Doctorate
    Thesis at University of Rochester.
Write a Comment
User Comments (0)
About PowerShow.com