Create Presentation
Download Presentation

Download Presentation
## Nature-inspired Design

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -

**Bob Durrant**http://www.cs.bham.ac.uk/~rjd/NID.html Revision Lectures Nature-inspired Design**Examination Details**• 1½ Hour closed-book exam for both NID(A) (undergrads) and NID (masters). • Some overlap in topics and questions on papers but NID will have some harder questions than NID(A). • NID(A): Four short questions plus 1/2 long questions. • NID: Compulsory question plus 2/3 long questions. • Saturday 16th May @ 14.00 in Staff House (provisional date and venue). • See http://www.examtimetables.bham.ac.uk**Multiobjective Optimisation example(Coello, “A short**tutorial on Evolutionary Multiobjective Optimisation”) Minimise the volume of the truss • And minimise the deflection d = f2 Subject to constraints:**Pareto optimality**Suppose we can find a set of variables x* such that there is no x (within constraints) that satisfies: fj(x) ≤fj(x*) for all j and fj(x) <fj(x*) for at least one j • We say that the set of values of x* are Pareto optimal**Dominance**A point in the search space, x , is said to dominate another such point y if the following conditions are true 1. x is not worse than y in all objectives fi 2. x is strictly better than y in at least one objective fi**Dominance example**A population of five points f2 (minimize) 2 5 4 3 1 5 3 1 18 6 2 10 14 f1 (maximize)**Pareto-optimal curves**Points on this line no worse in f2 than A but f1(A) is better f2 (minimize) f2 (maximize) A f1 (minimize) f1 (minimize) f2 (minimize) f2 (maximize) f1 (maximize) f1 (maximize) ? ? ?**Weighting method**Convert MOP to a SOP by forming a linear combination of objectives normalise all objectives choose weights so that they add to 1 • Can find all members of Pareto-optimal set if convex spaces. Cannot guarantee all members of Pareto-optimal set in concave spaces**MOGA (Fonseca & Fleming 1993)**1.For each chromosome ci calculate the number of chromosomes that dominate it (ni).Let rank ri=1+ni 2.Assign fitness to ci using linear interpolation so that ciwith lowest rank has maximum fitness 3. Average fitnesses of chromosomes with same rank and assign as the new fitness 4. Use niching methods to distribute chromosomes over the Pareto-optimal region The rest of the algorithm is a standard GA.**PAES (Knowles & Corne 2000)**1.Generate a random chromosome c 2.Generate an offspring by Gaussian mutation d 3. Choose a winner from c or d goto 2. (1+1)-ES**Choosing a winner (PAES)**An archive A of good solutions is kept if c dominates d then winner = c elseif d dominates c winner = d else case 1: if any member of A dominates d, winner = c case 2: d dominates member(s) of A, winner = d A = A-{members of A dominated by d} case 3: A=A+{d}, winner = most_isolated (a) Divide each objective into 2m equal divisions to calculate this**The "problem of premature convergence"**• In a conventional GA, the population quickly converges and this signifies the end of the search 14**SAGA**• SAGA = Species Adaptation Genetic Algorithms • In SAGA, converged population evolves • Population evolves as N species, each converged • Genotype length can increase (and decrease) • So dimensionality of fitness landscape can vary • `Solution space' can increase in complexity during evolution 15**Neutral (not neural!) networks**• Getting stuck in a local optimum is a worry • However, for many problems this is unlikely • Due to the presence of "neutral networks", along which all genotypes encode the same phenotype (solution) • For example, in an ANN, changing the weights on links to a neuron whose output is not currently linked to any other neuron will have no effect on the network's behaviour • So such a change is fitness neutral 16**Population sizes and run lengths**• Conventional GAs • Excluding some GAs that use coevolution • Evolution mainly due to convergence by selection and recombination • Large population sizes (10,000s or 1Ms) to supply (initial) variation • Relatively short run lengths (10s or 100s of generations) • SAGAs • Evolution mainly due to mutation • But selection and recombination both still important! • Small population sizes (100s or 10s) • Long run lengths (1000s or 1Ms of generations) 17**Example SAGA**• Thompson's hardware evolution experiment • Evolved a Field Programmable Gate Array (FPGA) to discriminate between 1kHz and 10kHz tones • Evolved FPGA after 5000 generations, & its functional connections (right): 18**Generic Evolutionary Design of Solid Objects (Bentley 1996)**Creation and optimisation of conceptual design of solid objects from scratch 19**Geometric primitive:Clipped stretched cube**x, y, z, height, width, depth, planedist, angle1, angle2 20**Fitness Measure:Sum of Weighted Global Ratios**As algorithm progresses calculate for each fitness objective i the global_max_fitnessi, global_min_fitnessi For each genotype j calculate its fitness ratioji • Multiply fitness_ratioji by importancei • fitness of genotype j is just the sum over i objectives 21**Examples (Table design)**Size Mass Stability Flat Supportiveness Symmetry 22**Karl Sims' "Blockies"**• Sims evolved artificial creatures for locomotion tasks: swimming, walking, jumping, following. • Both creature morphology (body structure) and neural controller were evolved, at the same time • 3D world with realistic simulated physics used as environment in which to evaluate creatures • Paper: • Sims, K.: Evolving Virtual Creatures, Computer Graphics (Siggraph 1994 Proceedings), 1994, pp.15-22. http://www.genarts.com/karl/papers/siggraph94.pdf 23**Simulated physics**• Realistic simulated physics • Essential part of the feedback loop (see figure) • Gravity, friction, collision detection & response, fluid effects, articulated bodies, ... More (and harder) than you might think! 24**Morphological development**• Genotype specifies a • directed graph. • This specifies how the • morphology is to be • developed, before `birth'. • Genotype also encodes • information about • sensors and effectors, • and neural development. 25**Recombination**• Recombination operators slightly more complex than normal • See paper for details • Recombination: 40% asexual, 30% crossovers, 30% grafting 26**Results 1**• Results show very • "realistic" behaviour. • Morphologies and • controllers well • matched to both • each other and the • task specified by • the fitness function. • Various locomotion- • based fitness functions • used. 27**Results 2**• Notice the very different, and impressive, solutions that evolution produced. • All solutions to (different runs of) the same problem 28**Biomorphs (The Blind Watchmaker, Dawkins 1986)**r g11 g12 g13 g14 g15 g21 g22 g23 g24 g25 g31 g32 g33 g34 g35 g41 g42 g43 g44 g45 Recursion depth Branching factor Branching angle Branch length Branch thickness Branch colour**Mutator(Evolutionary Art and Computers Latham and Todd,**1992) Defined shapes using their own parameterised predefined function commands (“Form Grow”) basic horn options inform, ribs, start, head, tail, texture… fractal horn options transforms stack, side, twist, bend, branch extensions to basic horns See chapter 9 of “Evolutionary Design by Computers”**Karl Sims (1991)**Used x, y coordinates of rectangular image as inputs to a lisp GP system. If bw is required then a single number can represent colour. If colour is required Sims used a 3-d vector (rgb or hsb) +, -, *, /, mod, round, min, max, abs, expt, log, and, or, xor, sin, cos, atan, if, dissolve, hsv-to-rgb, vector, transform-vector, bw-noise, color-noise, warped-bw-noise, warped-color-noise, blur, band-pass, grad-mag, grad-dir, bump, ifs, warped-ifs, warp-abs, warp-rel, warp-by-grad.**Sims' Coevolution of Block Creatures**• Sims evolved his blockies (discussed in lecture 3b) using a competition that involved two creatures • Creatures start equidistant from a target cube 38**Coevolution**• Most interesting results occurred once both species had discovered methods for reaching the cube • Creatures then in a struggle against each other, for the cube • Creatures evolved strategies to counter opponent species' strategies ... which were then counter-countered, ... • Coevolution 39**Artificial and Natural Selection**• We have seen that incorporating coevolution into a GA can result in qualitatively different (often better) results. • However, in the previous example, coevolutionary feedback was limited by fixed artificial selection criteria. • We also looked at a natural selection system, Tierra, in which there is no such limiting artificial selection. • See Ray's paper “Evolution, ecology and optimization of digital organisms”. • Read online (see tutorial 3). • Natural selection can result in open-ended evolution. • Existence proof: Real world. 40**Tierra**• Tierra is a system of self-replicating machine code programs. • As an evolutionary biologist, Ray was interested in comparing artificial evolution with that in the real world. • Each program was allowed to write to the block of memory it occupied but not outside that block. • However, programs could read and execute instructions from any part of memory. • A degree of artificial selection was imposed by the system itself deleting the oldest programs in order to free memory when it was full beyond a certain threshold, with an added bias against programs that generated error conditions. • This artificial selection constitutes just one of the parts of the system. It does not (necessarily) prevent natural selection • Tierra initially seeded with a single self-replicating ancestor program. 41**Results 2: Coevolution**• Ray reported that coevolution arose naturally in Tierra. • The hosts became immune to the parasites ... • ... which overcame these defences • ... and so on. • ``Hyper-parasite'' hosts emerged containing instructions that caused a parasite to copy the host rather than the parasite. • This could lead to the rapid elimination of parasites. • Ray also reported cooperation (symbiosis) in replication followed by ``cheaters'' (social parasites) which took advantage of cooperators. • See paper for details and further discussion. 42**CA and Nature Inspired Design**CA are inspired by and to some extent imitate life. They have been found to perform all sorts of computation. They have been used to model many agent based phenomena (forest fires, traffic flow, spread of disease, …). They illustrate the phenomenon of emergence. People have used evolutionary algorithms to try to evolve their rules to carry out certain forms of computation.**Cellular Automata**1 dimensional cellular automaton Line of cells, each of which may be in in one of a finite number of states. The state of a cell at the next time step is a function of its neighbours according to a fixed rule. if the next cell state is only dependent on a single neighbour on each of the left and right then we say the rule has radius 3, if it depends on two neighbours on each side, then radius is 5 and so on.**Example**1 1 1 1 1 0 1 0 rule 250 Initial state Time**Different rules starting with one cell**Rule 90 Rule 30 Rule 250 Rule 110**Two-dimensional CA**Moore Neighbourhood (9 cells) Von Neumann Neighbourhood (5 cells)**Stephen Wolfram’s classes**The fate of any initial configuration of cells is 1. To die out 2. To become stable or cycle with fixed period 3. To grow indefinitely with fixed speed 4. To grow and contract irregularly**Langton’s lambda**He defined a quantity lambda to be the fraction of CA rules in which the new state of the cell is living Rule 250: =0.75, Rules 108, 30: =0.5, Rule 110: =0.625 For CAs with more states and rules he found that: small leads to order approximately 0.5 leads to “edge of chaos” approaching 1 leads to chaos