遺傳演算法之 interactive evolutionary algorithms (iea) 資管系 王柳鋐

28
遺遺遺遺遺遺 Interactive Evolutionary Algori thms (IEA) 資資資 資資資

Upload: estella-moody

Post on 26-Dec-2015

251 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

遺傳演算法之Interactive Evolutionary Algorithms

(IEA)

資管系 王柳鋐

Page 2: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

2

Introduction(1/7)

• Interactive GA/EA = GA/EA + Interaction with human • Why Interaction?

– 以 Conventional GA/EA 解問題 決定編碼 (gene representation) 的方式 提供 fitness functions

– 以便進行 selection/reproduction 提供 genetic operators

– exploration of the search space

– exploitation of genetic material

• 三事俱備 , GA/EA 得以進行– 例 : TSP, 工程控制問題 , scheduling, 決策 , data mining …

– But, 如果無法提供上述三者之一 ???• 無適當編碼 , 無好用之 operators --> bad solution quality

• 無適當 fitness function --> right answers for wrong problem

Page 3: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

3

Introduction(2/7)

• Why can't we provide an appropriate fitness function?– 問題優劣的評估牽涉到…

• 直覺 (intuition), 偏好 (preference), 主觀意識 (subjectivity), 感覺(sensation), 感官知覺 (perception), 認知 (cognition), 心理運作(psychological processing)…

很難定義一個數學函式來代表 fitness function

– 好不好吃 ? 好不好聽 ? 好不好看 ?

– 像不像 ?

– 好不好用 ? 好不好玩 ?

• What can we do ?– 由人來評估

• 由人取代 selection function

Page 4: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

4

Introduction(3/7)

• Interactive GA/EA 的執行流程

Initialize population;while(The terminating condition is not satisfied) { Present individuals to the user; // phenotype or genotype The user gives the scores(evaluation) ; Reproduce individuals based on the user's evaluation(selection); Apply genetic operators to the survived individuals after selection;} 1. 必須具體呈現各個 individuals

因此 ,user interface 好壞有決定性影響2. 該呈現 individuals 的表現型 (phenotype) 或基因型 (genotype) 則不一定 , 以讓使用 者能有最佳評分的環境為原則

Page 5: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

5

Introduction(4/7)

• Interactive GA/EA 搜尋解答的概念

真正的解答空間IGA/EA 操作的解答空間

使用者心中的解答

IGA/EA呈現的解答使用者根據主觀意識考量 facter 1,2,…m,所給的分數 d( 指與心中解答的距離 )

評分

解答空間的轉換

空間轉換後 , 使用者給的距離 d, 轉化為 GA 的fitness value : d'

GA 操作

Page 6: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

6

Introduction(5/7)

• IGA/EA 面臨的技術難題– IGA/EA 雖然透過讓 human 加入評估的方式 , 解決 fitness fun

ction 難以決定的難題 , 卻也引來另一些技術問題• human fatigue ( 疲勞 ) problem

– population size 太大 , user 評估困難» 跨多個畫面 , 造成前後標準不一

因此 , population size 通常都很小

– 然而 , population size 小 收斂困難 , 因此必須執行許多代

fatigue problem !!!

– 技術有待解決» population 要小 ( 畫面大小 , 人類記憶… )

» 不能執行太多代 ,(Takagi 建議 10~20 代 )

» 但要能找到滿意解 (near-optima, 非 local optima)

Page 7: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

7

Introduction(6/7)

• 解決 human fatigue problem 的方向– Prediction

• 適當的 individuals 展示順序 , 有助於減輕 user 評估時的負擔• 預測 user 的喜好 , 根據喜好順序展示 individuals

• 預測方法– Neural Network

– Euclidian distance

– 增加 user 的權利• human fatigue problem 部分原因來自單調• 增加 user 評估 individuals 可做的動作

– 例 : 評估時允許 user 直接修改 GP tree

– 當 user 權利擴充之後 another kind of IGA/EA : HBGA

» Human Based Genetic Algorithms

Page 8: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

8

Introduction(7/7)

• Applications of IGA/EA– 藝術方面

• artificial life(art, animal & plant)

• car design

• dress design

• rhythm production( 音樂 )

– 工程方面• recovering filter for distorted speech

• facial recognition for criminal identification

• data mining

• MRI image enhancement

Page 9: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

9

Artificial Evolution for Computer Graphics

• Computer Graphics, 25(4), July 1991, pp. 319-328.– ACM SIGGRAPH '91 Conference Proceedings– 作者 : Karl Sims

http://www.genarts.com/karl/papers/siggraph91.html

• 摘要– Computer graphics and animation 的基本需求

• 2D/3D structures, textures, motions

– 使用 evolutionary techniques• Variation(mutation), interactive selection

– 透過視覺引導 : evolution in preferred direction

– Examples:• 3D plants• Images, solid textures, animations

– Genotype: symbolic expressions

Page 10: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

10

Artificial Evolution for Computer Graphics

• Introduction– Computer Graphics : scenes & animation creation

• 仰仗 procedural model: 複雜度高 , 修改不易

• 作者的想法– interactive "perceptual selection" "evolution" of procedural mode

l– 好處

• Large variety ( 即使無法 completely control the results)

• User 不需了解 underlying creation process

2D model : poly-lines drawing

3D model : poly-lines drawing

Page 11: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

11

Artificial Evolution for Computer Graphics

• Evolution & GA survey

Selection :Non-random,in phenotype

Mutation:random,in genotype

Page 12: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

12

Artificial Evolution for Computer Graphics

• Procedural model 的解答空間– fractals, graftals, procedural texturing

• Simple input information complex structure• N input parameters N-dimension space

• IEA 操作 : human selection

axiom: 0 1st Recursion: 1[0]0 2nd Recursion: 11[1[0]0]1[0]0 3rd Recursion: 1111[11[1[0]0]1[0]0]11[1[0]0]1[0]0

規則 :0 repeat 原先的 pattern1 11[,] 保留不變

Page 13: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

13

Artificial Evolution for Computer Graphics

• Evolving 3D Plant Structures– Genotype : 21 組參數

• fractal limits, branching factors, scaling, stochastic contributions…

– Phenotype : 3D tree structures– Growth rules

• Applying to 21 組參數 , arbitrarily small increments

– Interactive selection and the mutation methods – Final results – for further manipulation

• Rendering, texture mapping…

Page 14: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

14

Artificial Evolution for Computer Graphics

• Mutating parameter sets– Mutation 機率 : m– Small perturbation : 小於 d

• 例 : m=0.2, d=0.4

• Gaussian distribution instead of the simple linear distribution,

For each gi

If rand(.0,1.0) < m then g'i= gi + rand(-d, d) clamp or wrap g'i to legal bounds. else g'i = gi

Page 15: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

15

Artificial Evolution for Computer Graphics

• Mating Parameter Sets– 由人來選擇進行 recombination 的 individual

• Q1: fitness value?

– Human perceptual selection 評分• Q2: how to combine

– Various crossover methods

• Crossover methods– independently copied from one parent or the other

• N-dimensional genetic space 2N corners

Page 16: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

16

Artificial Evolution for Computer Graphics

• Crossover

parents

Children: 其餘

Page 17: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

17

Artificial Evolution for Computer Graphics

• Forest of ``evolved'' plants

Page 18: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

18

Artificial Evolution for Computer Graphics

• A limitation of genotypes described above– 參數固定 , fixed expression rules– solid boundaries on the set of possible phenotypes– no possibility for the evolution

• a new developmental rule

• a new parameter

• Solution : include procedural information in genotype– procedural and data elements

• not be restricted to a specific structure or size

– 做法 : Symbolic lisp expressions• Functions , argument generators arbitrary expressions

• Can be mutated, evolved, evaluated phenotype

Page 19: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

19

Artificial Evolution for Computer Graphics

• Evolving Images– generation of textures by mutating symbolic expressions– 計算 (x,y) 座標點上的顏色

• evolved using a function set

– some standard common lisp functions

– vector transformations

– procedural noise generators

– image processing operations

– Including :

+, -, *, /, 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.

計算結果 : an image of scalar (b/w) or vector (color) values

Page 20: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

20

Artificial Evolution for Computer Graphics

• Simple expression examples

(reading left to right, top to bottom)a. Xb. Yc. (abs X)d. (mod X (abs Y))e. (and X Y)f. (bw-noise .2 2)g. (color-noise .1 2)h. (grad-direction (bw-noise .15 2) .0 .0)i. (warped-color-noise (* X .2) Y .1 2)

Page 21: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

21

Artificial Evolution for Computer Graphics

• Evolving image 的程序– 產生 image 的程序

• choosing a function at random from the function set above

• generating random arguments

– A random scalar value such as .4

– A random 3-element vector such as #(.42 .23 .69)

– A variable such as the X or Y pixel coordinates.

– Another lisp expression which returns a b/w or color image

– Displaying a population in a grid for interactive selection– Images selected by the user are reproduced with mutations

Page 22: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

22

Artificial Evolution for Computer Graphics

• Mutation : top-left one is the parent

Page 23: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

23

Artificial Evolution for Computer Graphics

• Results

Page 24: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

24

Artificial Evolution for Computer Graphics

• Results(cont')

Page 25: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

25

Human Based Genetic Algorithms(1/4)

• 以 Conventional GA/EA 解問題 決定編碼 (gene representation) 的方式 提供 fitness functions

• 以便進行 selection/reproduction

提供 genetic operators(re-combination operators)• exploration of the search space

• exploitation of genetic material

• IGA/EA : 由人充當 selection operator

• How about the human as a recombination operator?– 由人充當和 crossover / mutation 一樣角色的 operator

• Creating new individuals

Page 26: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

26

Human Based Genetic Algorithms(2/4)

• Human Based Genetic Algorithms(HBGA)– 人可以擔任 selection operator 的角色 ( 評估 )– 也可以擔任 recombination operator 的角色 ( 創造 )

• HBGA is also a multi-agent system

Page 27: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

27

Human Based Genetic Algorithms(3/4)

• HBGA 流程Initialize population in the Central Agent;while(The terminating condition is not satisfied) { Present individuals to the user agents; Some user agents give the scores(evaluation) and the others can create new individuals(recombination); Central agent is responsible for coordinating the results between user agents(orgnization);}

Page 28: 遺傳演算法之 Interactive Evolutionary Algorithms (IEA) 資管系 王柳鋐

28

Human Based Genetic Algorithms(4/4)

• Classes of multi-agent genetic algorithms– selection : human, computer or physical– recombination : human , computer or physical– 各種組合產生 classes of MAGA