16.01.2013 Views

An Introduction to Genetic Algorithms - Boente

An Introduction to Genetic Algorithms - Boente

An Introduction to Genetic Algorithms - Boente

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

initial pattern on the input units. This would be trivial, except that the number of hidden units is smaller than<br />

the number of input units, so some encoding and decoding must be done.<br />

These are all relatively easy problems for multi−layer neural networks <strong>to</strong> learn <strong>to</strong> solve under<br />

back−propagation. The networks had different numbers of units for different tasks (ranging from 5 units for<br />

the XOR task <strong>to</strong> 20 units for the encoder/decoder task); the goal was <strong>to</strong> see if the GA could discover a good<br />

connection <strong>to</strong>pology for each task. For each run the population size was 50, the crossover rate was 0.6, and the<br />

mutation rate was 0.005. In all three tasks, the GA was easily able <strong>to</strong> find networks that readily learned <strong>to</strong> map<br />

inputs <strong>to</strong> outputs over the training set with little error. However, the three tasks were <strong>to</strong>o easy <strong>to</strong> be a rigorous<br />

test of this method—it remains <strong>to</strong> be seen if this method can scale up <strong>to</strong> more complex tasks that require much<br />

larger networks with many more interconnections. I chose the project of Miller, Todd, and Hegde <strong>to</strong> illustrate<br />

this approach because of its simplicity. For several examples of more sophisticated approaches <strong>to</strong> evolving<br />

network architectures using direct encoding, see Whitley and Schaffer 1992.<br />

Grammatical Encoding<br />

Chapter 2: <strong>Genetic</strong> <strong>Algorithms</strong> in Problem Solving<br />

The method of grammatical encoding can be illustrated by the work of Hiroaki Kitano (1990), who points out<br />

that direct−encoding approachs become increasingly difficult <strong>to</strong> use as the size of the desired network<br />

increases. As the network's size grows, the size of the required chromosome increases quickly, which leads <strong>to</strong><br />

problems both in performance (how high a fitness can be obtained) and in efficiency (how long it takes <strong>to</strong><br />

obtain high fitness). In addition, since direct−encoding methods explicitly represent each connection in the<br />

network, repeated or nested structures cannot be represented efficiently, even though these are common for<br />

some problems.<br />

The solution pursued by Kitano and others is <strong>to</strong> encode networks as grammars; the GA evolves the grammars,<br />

but the fitness is tested only after a "development" step in which a network develops from the grammar. That<br />

is, the "genotype" is a grammar, and the "phenotype" is a network derived from that grammar.<br />

A grammar is a set of rules that can be applied <strong>to</strong> produce a set of structures (e.g., sentences in a natural<br />

language, programs in a computer language, neural network architectures). A simple example is the following<br />

grammar:<br />

Here S is the start symbol and a nonterminal, a and b are terminals, and µ is the empty−string terminal.(S ’ µ<br />

means that S can be replaced by the empty string.) To construct a structure from this grammar, start with S,<br />

and replace it by one of the allowed replacements given by the righthand sides (e.g., S ’ aSb). Now take the<br />

resulting structure and replace any nonterminal (here S) by one of its allowed replacements (e.g., aSb ’<br />

aaSbb). Continue in this way until no nonterminals are left (e.g., aaSbb ’ aabb, using S ’ µ). It can easily be<br />

shown that the set of structures that can be produced by this grammar are exactly the strings a n b n consisting of<br />

the same number of as and bs with all the as on the left and all the bs on the right.<br />

Kitano applied this general idea <strong>to</strong> the development of neural networks using a type of grammar called a<br />

"graph−generation grammar," a simple example of which is given in figure 2.22a Here the right−hand side of<br />

each rule is a 2 × 2 matrix rather than a one−dimensional string. Capital letters are nonterminals, and<br />

lower−case letters are terminals. Each lower−case letter from a through p represents one of the 16 possible 2 ×<br />

2 arrays of ones and zeros. In contrast <strong>to</strong> the grammar fora n b n given above, each nonterminal in this particular<br />

grammar has exactly one right−hand side, so there is only one structure that can be formed from this<br />

grammar: the 8 x 8 matrix shown in figure 2.22b This matrix can be interpreted as a connection matrix for a<br />

55

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!