1 / 40

Artificial Intelligence Fuzzy logic

Artificial Intelligence Fuzzy logic. Fall 2008 professor: Luigi Ceccaroni. Uncertainty. - Modeling with uncertainty requires more than probability theory. - There are problems where boundaries are gradual. Examples: What is the boundary of Spain? What is the area of Spain?

darrelly
Télécharger la présentation

Artificial Intelligence Fuzzy logic

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Artificial IntelligenceFuzzy logic Fall 2008 professor: Luigi Ceccaroni

  2. Uncertainty - Modeling with uncertainty requires more than probability theory. - There are problems where boundaries are gradual. Examples: • What is the boundary of Spain? What is the area of Spain? • When does a tumor begin its formation? • What is the habitat of rabbits? • What is the depth of the sea 30 km east of Barcelona?

  3. Representing vagueness: Fuzzy sets and fuzzy logic • Fuzzy set theory is a means of specifying how well an object satisfies a vague description. • Example: • Consider the proposition “Carla is tall”. • Is this true, if Carla is 1.70? • Most people would hesitate to answer “true” or “false”, preferring to say “sort of”. • This is not necessarily a question of uncertainty about the external world. • We are sure of Carla’s height.

  4. Representing vagueness: Fuzzy sets and fuzzy logic • The linguistic term “tall” does not refer to a sharp demarcation of objects into two classes. • There are degrees of tallness. • Fuzzy set theory treats Tall as a fuzzy predicate and says that the truth value of Tall(Carla) is a number between 0 and 1, rather than being just true or false.

  5. Representing vagueness: Fuzzy sets and fuzzy logic • The name “fuzzy set” derives from the interpretation of the predicate as implicitly defining a set of its members. • A set that does not have sharp boundaries. • Fuzzy logic is a method for reasoning with logical expressions describing membership in fuzzy sets. • Example: • The complex sentence Tall(Carla) ∧Heavy(Carla) has a fuzzy truth value that is a function of the truth values of its components.

  6. Examples • In classical sets, either an element belongs or it does not. Examples: • Set of integers – a real number is an integer or not. • You are either in an airplane or not. • Your bank-account balance is 142 € or not. • The Bible is either the word of God, or it is not. • Either Christ was divine, or he was not. • Fuzzy sets are sets that have gradations of belonging. Examples: BIG Near Tall

  7. Degrees of truth: example • The temperature is pleasant. • Variable: temperature • Universe of values (U) or domain: real • The distribution indicates the degree of truth of the linguistic term pleasant. 1 0 0 20 30 40 ºC

  8. Degrees of truth: example • The temperature is low. • The temperature is high. low high 1 1 0 0 5 10 15 20 25 30 35 ºC 5 10 15 20 25 30 35 ºC

  9. Possibility function πA : U → [0, 1] The possibility function, or characteristic function, is often represented as a trapezoidal or triangular approximation, which can be characterized by the abscises of the vertexes. (0, 20, 30, 40) 1 0 1 0 0 20 30 40 0 20 30 40

  10. Practical representation of fuzzy sets • Degrees of fever: • Fever is Low (37,37,37.6,38) • Fever is Medium (37.6,38, 38.5,39) • Fever is High (38.5,39,43,43) μfever (temperature) μlow μmedium μhigh 1.0 0.7 0.3 0.0 0º 37º 38º 39º 43º temperature

  11. Practical representation of fuzzy sets • [Temperature is Gelada] • [Temperature is Molt Freda] • [Temperature is Freda] • [Temperature is Fresca] • [Temperature is Agradable] • [Temperature is Calorosa] • [Temperature is Molt Calorosa] 1 0 MF F FS C MC G A 0 5 10 15 20 25 30 35 • Each variable has a domain and a set of labels or linguistic terms. • Each label corresponds to a characteristic function defined over the domain.

  12. Control variable Variation of temperature • [VC is Poc Positiva] • [VC is Gairebé Zero] • [VC is Poc Negativa] • [ΔT Puja Molt] • [ΔT Puja Poc] • [ΔT Gairebé Igual] • [ΔT Baixa Poc] • [ΔT Baixa Molt] Practical representation of fuzzy sets BM BP GI PP PM -10 -7,5 0 -7,5 10 PN GZ PP -5 -1 0 1 5

  13. Fuzzy logic: connectives • Fuzzy logical connectives are defined as functions in the [0,1] interval, which generalize classic connectives: Intersection of sets ≡ P ∧ Q ≡ T-norm (P,Q) Union of sets ≡ P ∨ Q ≡ T-conorm (P,Q) Complement of a set ≡¬P ≡ Negation function (P) Inclusion of sets ≡ P → Q ≡ Implication function (P,Q) 13

  14. Fuzzy negation • “Negation function” N : [0,1] → [0,1] • Properties • N(0) = 1 and N(1) = 0 boundary conditions • N(p) ≥ N(q) if p ≤ q monotony • N(N(p)) = p involution • Examples • N(x) = 1-x • Nw(x) = (1-xw)1/w∀ w > 0 Yager family • Nt(x) = (1-x) / (1+t*x) ∀ t > -1 Sugeno family 14

  15. Fuzzy conjunction • “T-Norms” T : [0,1] x [0,1] → [0,1] • Properties • T(p,q) = T(q,p) commutability • T(p,T(q,r)) = T(T(p,q),r) associativity • T(p,q) ≤ Τ(r,s) if p ≤ r ∧ q ≤ smonotony • T(0,p) = T(p,0) = 0absorbing element • T(1,p) = T(p,1) = pneutral element • Examples • T(x,y) = min (x,y)minimum • T(x,y) = x*y algebraic product • T(x,y) = max (0, x+y-1)bounded difference • T(x,y) = x*y / (x+y-x*y) 15

  16. Fuzzy disjunction • “T-Conorms” S : [0,1] x [0,1] → [0,1] • Properties • S(p,q) = S(q,p) commutability • S(p,S(q,r)) = S(S(p,q),r) associativity • S(p,q) ≤ S(r,s) if p ≤ r ∧ q ≤ s monotony • S(0,p) = S(p,0) = pneutral element • S(1,p) = S(p,1) = 1absorbing element • Examples • S(x,y) = max (x,y)maximum • S(x,y) = x+y-x*y algebraic sum • S(x,y) = min (x+y,1)bounded sum • S(x,y) = (x+y -2x*y) / (1-x*y) 16

  17. Relations between T-norms and T-conorms • De Morgan laws: N(T(x,y)) = S(N(x),N(y)) N(S(x,y)) = T(N(x),N(y)) • T(x,y) = min (x,y) S(x,y) = max (x,y) • T(x,y) = x*y S(x,y) = x+y - x*y • T(x,y) = max (0, x+y-1) S(x,y) = min (x+y,1) • T(x,y) = x*y / (x+y-x*y) S(x,y) = (x+y -2x*y) / (1-x*y) 17

  18. Fuzzy connectives over the same universe • If F ≡ [X is A] and G ≡ [X is B] with possibility distributions ΠA and ΠB defined over the same universe U: F ∧ G ≡ [X is A ∧ B] with ΠA∧B(u) = T(ΠA(u) ,ΠB(u)) T-norm F ∨ G ≡ [X is A ∨ B] with ΠA∨ B(u) = S(ΠA(u) ,ΠB(u)) T-conorm ¬ F ≡ [X is ¬ A] with Π¬ A(u) = N(ΠA(u)) Negation function 18

  19. Fuzzy connectives over the same universe

  20. Fuzzy connectives over different universes • If F ≡ [X is A] and G ≡ [Y is B] with possibility distributions ΠA defined over U i ΠB defined over V, U≠V: F ∧ G ≡ [X is A] ∧ [Y is B] with ΠA∧B(u,v) = T(ΠA(u) ,ΠB(v)) T-norm F ∨ G ≡ [X is A] ∨ [Y is B] with ΠA∨ B(u,v) = S(ΠA(u) ,ΠB(v)) T-conorm Functions are defined in two different dimensions. 20

  21. Fuzzy connectives over different universes

  22. Fuzzy connectives over different universes: conjunction

  23. Fuzzy connectives over different universes: conjunction

  24. Fuzzy connectives over different universes: disjunction

  25. Fuzzy connectives over different universes: disjunction

  26. Temperature • [Gelada] • [Molt Freda] • [Freda] • [Fresca] • [Agradable] • [Calenta] • [Molt Calenta] Fuzzy inference with crisp data • Rule base where atoms are fuzzy labels [X = A]: R1: If T = MC andΔT = PM then VC = PN R2: If T = C andΔT = PM then VC = PN R3: If T = MC andΔT = PP then VC = PN R4: If T = A andΔT = PP then VC = GZ • How to combine these rules for inference?

  27. Fuzzy inference with crisp data: connectives • Interpretation of connectives: • Negation: N(x) = 1-x • Conjunction: fuzzy intersection = T-norms (T) • Disjunction: fuzzy union = T-conorms (S) 27

  28. Fuzzy inference with crisp data: phases • Evaluation of the antecedent of the rules • Evaluation of the conclusions of the rules • Combination of the conclusions of the rules • Defuzzification

  29. Phase 1: Evaluation of rules’ antecedents The membership degree of each atom of the antecedent is calculated and combined according to the interpretation of the connectives. Ex.: R1: If T = MC andΔT = PM then ... min MC 1 G MF F FS C A BM BP GI PP PM 0,4 0,4 0,2 0,2 -10 -7,5 0 -7,5 10 0 5 10 15 20 25 30 26 8,5 Input: T = 26ºC, ΔT = 8.5ºC

  30. Control variable • [Poc Positiva] • [Gairebé Zero] • [Poc Negativa] Phase 2: Evaluation of rules’ conclusions • The fuzzy set of the conclusion is truncated with the value coming from antecedent calculations. R1. If ... then VC = PN Control Variable Control Variable PN 0,2 0,2 -5 -1 0 1 5 -5 -1 0 1 5

  31. Phase 3: Combination of rules’ conclusions Control Variable Conclusions are always disjunctively combined. 0,2 R1 -5 -1 0 1 5 0,8 0,4 0,4 min R2 -5 -1 0 1 5 R3... 0,6 R4 -5 -1 0 1 5 -5 -1 0 1 5

  32. Phase 4: defuzzification • Defuzzification Σx∈D μ(x) · x Σx∈D μ(x) mass center -5 -1 0 1 5 -5 –1.5 0 1 5

  33. Inferència difusa amb dades difuses Tenim una base de regles on els àtoms son etiquetes difuses [X = A] Si Temperatura = Agradable … llavors Gir = Una mica a la dreta • Volem fer inferència: • amb encadenament cap endavant; • a partir d’etiquetes difuses per les variables.

  34. Inferència difusa amb dades difuses: Fases • Avaluació de la relació expressada en cada regla (grau o funció d’implicació) μI(x,y) • Avaluació de la funció de pertinença de l’antecedent μA(x) • Composició inferencial (Modus ponens) de la implicació i l’antecedent μCI(x,y) = f(μI(x,y), μA(x))

  35. Inferència difusa amb dades difuses: Implicació Funcions d’implicació, I : [0,1] x [0,1] → [0,1] • Propietats • I(p,q) és creixent respecte a la primera variable i decreixent respecte a la segona variable • I(0,p) = 1 • I(1,p) = p • I(p,I(q,r)) = I(q,I(p,r)) (intercanvi d’antecedents) • R-implicacions / S-implicacions • S-implicacions • a → b = ¬ a ∨ b • I(x,y) = S(N(x),y) • Exemples de S-implicacions • I(x,y) = màx (1-x,y) • I(x,y) = 1-x+x*y • I(x,y) = mín (1-x+y,1)

  36. Inferència difusa amb dades difuses: Modus ponens Les inferències en lògica difusa utilitzen el modus ponens com a regla bàsica: Si [X és A] llavors [Y és B ] [X és A] [Y és B ] La combinació de funcions de possibilitat es realitza mitjançant la funció generadora de modus ponens.

  37. Modus ponens Emprant algunes de les definicions anteriors d’implicació i el modus ponens, és possible definir el procés d’inferència difusa: p ∧ (p → q) → q Donades les certeses d’un antecedent i de la implicació, la determinació de la certesa del conseqüent es realitza en base a una funció generadora del modus ponens que denominem mod(). La funció mod() té una sèrie de propietats, algunes de les quals són les següents: a) mod(u, imp(u, v)) ≤ v b) mod(1, 1) = 1 c) mod(0, u) = v d) u ≤ v ⇒ mod(u, w) ≤ mod(v, w) b) Aquest és el límit booleà del modus ponens a) La funció mod() té com a cota superior la certesa del conseqüent. c) D’un antecedent completament fals es pot concloure qualsevol cosa. d) La funció mod() ha de ser monòtona creixent amb la certesa de l’antecedent.

  38. Modus ponens Funciones generadoras del modus ponens que resultan de las definiciones de la función implicación presentadas anteriormente:

  39. Generalització del modus ponens La lògica difusa gaudeix de l’avantatge de poder fer inferències sense tenir exactament l’antecedent d’una regla: Si [X és A] llavors [Y és B] [X és A’] [Y és B’ ] S’ha de calcular com es modifica la conclusió, ja que no tenim el mateix antecedent de la regla. Això es fa mitjançant la transformació de la funció de possibilitat de A’ en la de A

More Related