ing models: how they work and how they are constructed i ndividual based n eural network g enetic...

26
ING models: how they work and how they are constructed Individual based Neural network Genetic algoritm by Espen Strand and Geir Huse

Upload: johnathan-hillock

Post on 19-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

ING models:how they work and how they are

constructedIndividual based Neural network Genetic algoritm

by Espen Strand and Geir Huse

Page 2: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

ING models - Presentation layout:

• Representation of individuals– Attribute and strategy vector, super-individual

• The genetic algorithm in ING models– Structure, initiation, selection vs. variability,

reproduction– Model constraints (avoiding Darwinian monsters)– Fitness in ING models

• The neural network– Network architecture, types of input, stimuli

transformation• One example of an ING model

Page 3: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

The individuals

• All individuals are numerically described by a unique strategy vector (easy think of it as genes):

• All individuals’ states are described in the attribute vector:

Strategy vector (length n)

3.2 1.3 -0.3 2.7 -4.1 2.3 0.1 1.0 …. n

1.6 kg 590 days 34g fat female 303 eggs

Attribute vector

Page 4: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

Super-individuals

• There is, depending on model complexity, an upper practical limit to how many individuals that can be simulated

• In models where the number or biomass of individuals are important and very high, a way around this problem is to treat each individual as a super-individual

• A super-individual simply has a number added to its attribute vector telling how many (identical) individuals it represents

500 ind 590 days 34g fat female 303 eggs

Attribute vector

Page 5: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

The genetic algorithm (GA)

• A GA is an algorithm that mimics evolution by natural selection.

So - what is required to make evolution possible?

1. A population of individuals

2. Genetic variability among individuals

3. A genotype – phenotype relationship

4. Individual variation in phenotypic success (fitness)

5. Inheritability of genotypes from one generation to the next

6. Introduction of new genetic variance (at least in the long run)

• How is this implemented in a GA?

Page 6: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

Implementing a GA - I

Ind # Sv(1) Sv(2) Sv(3) Sv(…) Sv(n)

1 2.3 -0.4 2.1 … 0.2

2 3.4 1.0 5.0 … 4.2

3 -1.4 2.1 -1.6 … 0.3

… … … … … …

N 0.03 2.1 -2.6 … -0.4

Strategy vector (length n)

Pop

ulat

ion

(siz

e N

)

1 2

3

N …

1. A population of individuals

2. Genetic variability among individuals

3. A genotype – phenotype relationship

4. Individual variation in fitness

5. Inheritability of genotypes from one generation to the next

6. Introduction of new genetic variance

Page 7: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

Linking behaviour to GA

1

2

Dep

th

Input 1

Input 2

Input 3

Input 4

Input 5

3.2 1.3 -0.3 2.7 -4.1 2.3 0.1 1.0 -2.1 0.5

Behaviour

Strategy vector

Neural network

1. A population of individuals

2. Genetic variability among individuals

3. A genotype – phenotype relationship

4. Individual variation in fitness

5. Inheritability of genotypes from one generation to the next

6. Introduction of new genetic variance

•This link is the cornerstone of an ING-model

Page 8: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

Implementing a GA - III

500 ind 90 days 34g fat female 303 eggs

Attribute vector

0.4 ind 90 days 0.4g fat female 3 eggs

1. A population of individuals

2. Genetic variability among individuals

3. A genotype – phenotype relationship

4. Individual variation in fitness

5. Inheritability of genotypes from one generation to the next

6. Introduction of new genetic variance

Page 9: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

Implementing a GA - IV

+ = or

Strategy vectors

1. A population of individuals

2. Genetic variability among individuals

3. A genotype – phenotype relationship

4. Individual variation in fitness

5. Inheritability of genotypes from one generation to the next

6. Introduction of new genetic variance

Page 10: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

About fitness (or: who gets to reproduce?)

• There are two distinctly different ways to incorporate fitness in an ING-model– By using a fitness measure (applied fitness)

• sort all individuals in the population according to the fitness measure and only let the fit ones reproduce. A fitness measure is imposed on the population. Replace the old generation with the new one. No chance of extinction. No population dynamics.

– By simulating the individuals’ entire life-span including mortality, gonad development, foraging, metabolic expenditure, etc… (emergent fitness)

• individuals will reproduce off-spring according to how well they adapted they are to the environment. Fitness becomes an emergent property of the model. The off-spring is added to the population as juveniles and do not replace existing individuals. Emergent population dynamics. Population may go extinct.

Page 11: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

Model constraints

• Environment

• Physiology– Temperature dependent effects– Stomach limitation– Prey size limitations– Behavioural limitations– …. (this list really never ends)

Page 12: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

GA overview

Page 13: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

Artificial Neural Network

• The basic idea of an ANN was to make an algorithm that mimicked how a brain makes decisions based stimuli

From www.greenspine.ca/media/neuron_culture_800px.jpg

A real network of neurons An artificial neural network (ANN)

Page 14: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

Artificial Neural Network - Architecture

• An ANN is constructed of:– Input– Input nodes– Input connection weights– Hidden nodes– Hidden node bias– Output connection

weights– Output node(s)

Page 15: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

Artificial Neural Network – Input node

• An input node receive a specific input and scales it linearly to a value between 0 and 1

minmax

min

ii

iii inputinput

inputinputInputNode

Page 16: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

Artificial Neural Network – Hidden node

• The hidden node sums all input connection weights (CW) multiplied with the input node value

1

)(i

ijij CWInputNodeHiddenNode

Page 17: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

Artificial Neural Network – Transformation

• After obtaining the value HiddenNodej the value is transformed non-linearly. Most often a sigmoid function is used. A bias is also often included.

)(1

1jj biasHiddenNodejT

eHiddenNode

0.0

0.2

0.4

0.6

0.8

1.0

-10 -5 0 5 10

HiddenNode

jT

HiddenNodej

Page 18: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

Artificial Neural Network – Output

• The output node sums the transformed hidden node values multiplied with the output connection weights

1

)(j

jkiTk CWHiddenNodeOutputNode

Page 19: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

Artificial Neural Network – Behaviour

• The value calculated by the output node(s) is used to determine behaviour. This can be done in several ways:

– Use value directly (e.g. output = swimming speed)

– Use it to determine incremental step in behaviour (e.g. NewDepth = OldDepth + output)

– Transform it (sigmoid) and multiply with some maximum range(e.g. NewDepth = MaxDepth*outputT)

Page 20: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

ING-models: Pros and cons

• Cons– No guarantee that the optimal solution is found– Need to run replicate simulations– Can be difficult to “decode” the adapted neural network

ANN = black box?• Pros

– Can incorporate very high levels of complexity:• Stochasticity, Intra- and Inter-specific competition

– Can be used to study emergent patterns on different levels simultaneously:

• Population dynamics, state-dependent behaviour– Can avoid using a measure of fitness by making fitness an

emergent property of the model.

Page 21: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

Example: A model of a planktivours fishStrand, E., Huse,G., Giske, J. (2002)

• Time resolution– Simulates 1 day every month (and scales it to

the entire month)– Each day is divided into 5 minutes time-steps– Run for several hundred generations

• Behaviour and life-history strategy– Depth position– Energy allocation– Spawning strategy

• Emergent fitness• Main focus

– Differences in juvenile and adult behaviour– Effects from stochastic juvenile survival on life-

history and behaviour

Page 22: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

Example: A model of a planktivours fish

Page 23: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

Vertical migration

From Baliño and Aksnes (1991)

Page 24: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

Energy allocation

Data from Hamre (1999)

Data from Hamre (1999)

Page 25: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

Spawning behaviour

Page 26: ING models: how they work and how they are constructed I ndividual based N eural network G enetic algoritm by Espen Strand and Geir Huse

The End