About the Lsys GNN encoding method

The Lsys GNN encoding alphabet is constructed from constrained L-System rules. L-systems were introduced and developed in 1968 by Aristid Lindenmayer, and are used to describe growth patterns in biological organisms. An L-system consists of an alphabet of symbols that can be used to make strings, a collection of production rules that expand each symbol into some larger string of symbols, and an initial axiom string from which to begin the construction. In the Lsys definition below the initial axiom and the left side of the rules are implied. The Lsys GNN encoding method scales at log2(n), where n is the number of neurons in the GNN.


Formal definition of the Lsys GNN encoding method

 

Terminology

Xi = L-symbol variable of level i.

n = number of neurons.

W = independently specified weight value.


L-symbols

A1,B1,C1,D1 = level one L-symbol.

A2,B2,C2,D2 = level two L-symbol.

A3,B3,C3,D3 = level three L-symbol.

A4,B4,C4,D4 = level four L-symbol.

....

Ai,Bi,Ci,Di = level i L-symbol, where i=log₂(n)-2.

a,b,c,...,p = terminal level L-symbol, where i=log₂(n)-1.

 

Each L-symbol from level i is expanded to a string of four L-symbols from level i+1.

  • Ai -> Level[i+1][1..4]
  • Bi -> Level[i+1][5..8]
  • Ci -> Level[i+1][9..12]
  • Di -> Level[i+1][13..16]

 

For the final expansion, level log₂(n):

If the expansion rule set is a connectivity matrix then

a is expanded to 0 0 0 0

b is expanded to 0 0 0 1

c is expanded to 0 0 1 0

....

p is expanded to 1 1 1 1

If the expansion rule set is a weight matrix then

a is expanded to W W W W [1..4]

b is expanded to W W W W [5..8]

c is expanded to W W W W [9..12]

....

p is expanded to W W W W [61..64]

 

 

An example Lsys encoding genotype for 256 neurons:

 

[Herbivore 1]

CABC

GHEHFEGGHFGEHHGH

KJIIJKKIIILKIILL

MNMNMNNNOOMNONOO

STRRSRQQSQRRTTTR

WWVWWXVVWUXVXUVV

dojfedepjdanfmnp

00000001001000110100…1111 <this line is coded, not included in the genotype>

DDBD

GHHFEFHEGGEFEGEE

KKLJLKJLJIIIKJII

MMONNPOOOOMNMMNO

RSRTQQRSRTTTRSRR

WWUUUUWXUXXVUUUU

dnndddnnbbddindd

0 10 0 0 -4 5 -10 -5 100 -2 100 -4 -5 -10 -10 -10 0 0 100 0 100 100 -2 0 0 0 0 0 0 0 100 100 0 4 0 -10 100 -1 0 0 0 0 0 0 0 0 100 -8 100 -8 0 100 -5 -10 -4 -10 0 0 -3 0 0 0 2 100

 

Wp1hgn use case of W: W = integer value from the set [-10 … 10, 100], 0 = soft connection, 100 = adult learning soft connection. If W <> 0 or 100 then the associated connection is set to hard connection with weight W/10.

 

Note: the expansion symbols for layers 1 - log₂(n)-2 do not have to necessarily be distinct characters. All symbols in layers 1 - log₂(n)-2 can be comprised of the same four distinct characters. Location specifies level.