Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

241-320 Design Architecture and Engineering

for Intelligent System


Lecture 14:
Suntorn Witosurapot
Reasoning under Uncertainty
Contact Address:
Phone: 074 287369 or (Fuzzy System)
Email: wsuntorn@coe.psu.ac.th

January 2010

Preview: Outline

 One drawback of the logical approach to reasoning is  Motivation


that an agent can rarely ascertain the truth of all
propositions in the environment
 Fuzzy Sets
 In fact, propositions (and their logical structure) may
 Fuzzy (Linguistic) Variables
be inappropriate for modelling some domains –  Fuzzy Logic
especially those involving uncertainty  Fuzzy Inferences: “IF-THEN” Rules
 Fuzzy logic can formalize “approximate” knowledge
and reasoning, hence giving us rational decisions

241-320 Design Architecture & Fuzzy System 3 241-320 Design Architecture & Fuzzy System 4
Engineering for Intelligent System Engineering for Intelligent System

What does Fuzzy Logic mean? What does Fuzzy Logic mean? (cont.)

 Fuzzy logic was introduced by Lotfi Zadeh


(UC Berkeley) in 1965.
 Fuzzy logic (ตรรกแบบคลุมเครือ) is based on fuzzy set
theory, an extension of classical set theory.
– ตรรกในการทํ างานที่มีมากกวา “ถูก” หรือ “ผิด” แตมี
“อาจจะ” เพิ่มขึ้ น ซึ่งคลายคลึ งกับความคิดมนุษย
 Fuzzy logic did not attract any attention until the 1980s
(fuzzy controller applications)
ตรรกแบบจริง/เท็จ เปรียบเที ยบกับ ตรรกแบบคลุมเครือ

241-320 Design Architecture & Fuzzy System 5 241-320 Design Architecture & Fuzzy System 6
Engineering for Intelligent System Engineering for Intelligent System

1
Fuzzy is Just Human Fuzzy is Economical
 Fuzziness as a principle of economics:
 Humans primarily use fuzzy terms: large, small, fast,
– Precision is expensive.
slow, warm, cold, ...
– Only apply as much precision to a problem as
 We say: necessary.
“If the weather is nice and I have a little time, I will
probably go for a work along the river.”
 We don’t say:
Precision
“If the temperature is above 24 degrees and the cloud
may not
cover is less than 10 percent, and I have 3 hours time,
significant in
I will go for a work with a probability of 0.47.”
the real world

241-320 Design Architecture & Fuzzy System 7 241-320 Design Architecture & Fuzzy System 8
Engineering for Intelligent System Engineering for Intelligent System

Outline Basics of Fuzzy Sets

 Motivation  Example: the set of “young people”


 Fuzzy Sets
 Fuzzy (Linguistic) Variables
 Fuzzy Logic  We can define a characteristic function for this set:
 Fuzzy Inferences: “IF-THEN” Rules

241-320 Design Architecture & Fuzzy System 9 241-320 Design Architecture & Fuzzy System 10
Engineering for Intelligent System Engineering for Intelligent System

Basics of Fuzzy Sets (cont.) Fuzzy Membership Function


 Fuzzy set theory offers a variable notion of
membership:
– A person of age 25 could still belong to the set of
young people, but only to a degree of less than
on, say 0.9.

– Now the set of young contains people with ages


between 20 and 30, with a linearly decreasing
degree of membership.
241-320 Design Architecture & Fuzzy System 11 241-320 Design Architecture & Fuzzy System 12
Engineering for Intelligent System Engineering for Intelligent System

2
Fuzzy Membership Function (cont.)
Shapes for Membership Functions
Fuzzy Membership Function (cont.)

 Typically, triangular membership functions are


chosen for fuzzy numbers.

241-320 Design Architecture & Fuzzy System 13 241-320 Design Architecture & Fuzzy System 14
Engineering for Intelligent System Engineering for Intelligent System

Testing for your understanding Testing for your understanding: Solution


 Improve the following set of tall man to cover better  The improved set can be defined by a continuously
representation of the tallness of a person. inclining function.

• So the 1st person has a membership of 0.3 and so is not very tall.
• The 2nd person has a membership of 0.95 and so he has a high
It just says that people taller than or equal to 6 feet are tall. degree of membership in the fuzzy set of tall men.
241-320 Design Architecture & Fuzzy System 15 241-320 Design Architecture & Fuzzy System 16
Engineering for Intelligent System Engineering for Intelligent System

In essense Outline

 A fuzzy set is a collection of objects that might belong  Motivation


to the set to a degree, varying from 1 for full
belongingness to 0 for full non-belongingness, through
 Fuzzy Sets
all intermediate values.  Fuzzy (Linguistic) Variables
 Fuzzy logic is a generalization of standard logic, in  Fuzzy Inferences: “IF-THEN” Rules
which a concept can possess a degree of truth
anywhere between 0.0 and 1.0.
 Fuzzy logic is used for reasoning about inherently
vague concepts. Ex: for the “tallness”, we might say
that ‘Michael Jordan is tall,' with degree of truth of 0.9

241-320 Design Architecture & Fuzzy System 17 241-320 Design Architecture & Fuzzy System 18
Engineering for Intelligent System Engineering for Intelligent System

3
Fuzzy (Linguistic) Variables Fuzzy (Linguistic) Variables (cont.)

 Fuzzy Linguistic Variables are used to represent  Temp: {Freezing, Cool, Warm, Hot}
qualities spanning a particular spectrum  Degree of Truth or "Membership"
– Can be seen as the vocabulary of a Fuzzy Logic System
 Example, Temp: {Freezing, Cool, Warm, Hot}
– Q: What is the temperature?
– A: It is warm.
– Q: How warm is it?
– A: ?? -> This somehow refers to the Membership Function

241-320 Design Architecture & Fuzzy System 19 241-320 Design Architecture & Fuzzy System 20
Engineering for Intelligent System Engineering for Intelligent System

Fuzzy (Linguistic) Variables (cont.) Fuzzy (Linguistic) Variables: Example


Q: How cool is 36 F° ?
Linguistic variables/
A: It is 30% Cool and 70% Freezing Fuzzy label Numerical interval Typical value

Always [1.00, 1.00] 1.0


Very strong [0.95, 0.99] 0.99
0.7 Strong [0.80, 0.94] 0.9
More or less strong [0.65, 0.79] 0.7
Medium [0.45, 0.64] 0.5
More or less weak [0.30, 0.44] 0.3
0.3
Weak [0.10, 0.29] 0.2
Very weak [0.01, 0.09] 0.05
No [0.00, 0.00] 0.0

241-320 Design Architecture & Fuzzy System 21 241-320 Design Architecture & Fuzzy System 22
Engineering for Intelligent System Engineering for Intelligent System

Outline Fuzzy Logic

 Motivation  How do we use fuzzy membership functions in


predicate logic?
 Fuzzy Sets
 Fuzzy logic Connectives:
 Fuzzy (Linguistic) Variables
– Fuzzy Conjunction, 
 Fuzzy Logic – Fuzzy Disjunction, 
 Fuzzy Inferences: “IF-THEN” Rules  Operate on degrees of membership in fuzzy sets

241-320 Design Architecture & Fuzzy System 23 241-320 Design Architecture & Fuzzy System 24
Engineering for Intelligent System Engineering for Intelligent System

4
Fuzzy Disjunction Fuzzy Conjunction
 AB max (A, B)  AB min(A, B)
 A  B = C "Quality C is the disjunction of  A  B = C "Quality C is the conjunction of
Quality A and B" Quality A and B"

 (AB = C)  (C = 0.75)  (AB = C)  (C = 0.375)

241-320 Design Architecture & Fuzzy System 25 241-320 Design Architecture & Fuzzy System 26
Engineering for Intelligent System Engineering for Intelligent System

Question: Fuzzy Conjunction Outline


Calculate A  B given that A is 0.4 and B is 20
 Motivation
0.9  Fuzzy Sets
0.7
 Fuzzy (Linguistic) Variables
 Fuzzy Logic
 Fuzzy Inferences: “IF-THEN” Rules
– Determine degrees of membership:
• A = 0.7 B = 0.9
– Apply Fuzzy AND
• A  B = min(A, B) = 0.7
241-320 Design Architecture & Fuzzy System 27 241-320 Design Architecture & Fuzzy System 28
Engineering for Intelligent System Engineering for Intelligent System

Fuzzy Inferences: “IF-THEN” Rules Example: Fuzzy Control

 A fuzzy rule is a linguistic expression of causal  Fuzzy Control combines the use of fuzzy linguistic
dependencies between linguistic variables in form of variables with fuzzy logic
if-then statements.  Example: Speed Control
 General form: IF <antecedent> then <consequence> Q: How fast am I going to drive today?
 Example: A: It depends on the weather.
– If temperature is cold and oil price is cheap -> So, this implies disjunction or conjunction of
• Then heating is high fuzzy operations

Linguistic variables Linguistic values


241-320 Design Architecture & Fuzzy System 29 241-320 Design Architecture & Fuzzy System 30
Engineering for Intelligent System Engineering for Intelligent System

5
Example: Fuzzy Control (cont.) Example: Fuzzy Control (cont.)
Temp: {Freezing, Cool, Warm, Hot}
Rules:
 If it's Sunny and Warm, drive Fast
Sunny(Cover)  Warm(Temp)  Fast(Speed)
 If it's Cloudy and Cool, drive Slow
Cover: {Sunny, Partly, Overcast} Speed: {Slow, Fast} Cloudy(Cover)  Cool(Temp)  Slow(Speed)
 Driving Speed is the combination of output of these
rules...

241-320 Design Architecture & Fuzzy System 31 241-320 Design Architecture & Fuzzy System 32
Engineering for Intelligent System Engineering for Intelligent System

Example: Fuzzy Control (cont.)


Example: Fuzzy Control (cont.) Fuzzification: Calculate Input Membership Levels

 Q: How fast will I go if it is  65 F°  Cool = 0.4, Warm= 0.7

– 65 F°
– 25 % Cloud Cover ?

 25% Cover  Sunny = 0.8, Cloudy = 0.2

241-320 Design Architecture & Fuzzy System 33 241-320 Design Architecture & Fuzzy System 34
Engineering for Intelligent System Engineering for Intelligent System

Example: Fuzzy Control (cont.) Example: Fuzzy Control (cont.)


Fuzzification: Calculate Input Membership Defuzzification: Constructing the Output

 If it's Sunny and Warm, drive Fast  Speed is 20% Slow and 70% Fast
Sunny(Cover)Warm(Temp)Fast(Speed)
0.8  0.7 = 0.7
 Fast = 0.7

 If it's Cloudy and Cool, drive Slow


Cloudy(Cover)Cool(Temp)Slow(Speed)
0.2  0.4 = 0.2  Find centroids: Location where membership is 100%
 Slow = 0.2

241-320 Design Architecture & Fuzzy System 35 241-320 Design Architecture & Fuzzy System 36
Engineering for Intelligent System Engineering for Intelligent System

6
Example: Fuzzy Control (cont.) Example: Fuzzy Control (cont.)
Defuzzification: Constructing the Output Defuzzification: Constructing the Output

 Speed is 20% Slow and 70% Fast  Speed is 20% Slow and 70% Fast

 Speed = weighted mean  Speed = weighted mean


= (2*25+... = (2*25+7*75)/(9)
= 63.8 mph
241-320 Design Architecture & Fuzzy System 37 241-320 Design Architecture & Fuzzy System 38
Engineering for Intelligent System Engineering for Intelligent System

Notes: Fuzzy inference: In essence

 Fuzzy Logic Control allows for the smooth  Inputs to a fuzzy system can be:
interpolation between variable centroids with – fuzzy, e.g. (Score = Moderate), defined by
relatively few rules membership functions;
 This does not work with crisp logic (traditional Boolean) – exact, e.g.: (Score = 190); defined by crisp values
– a crisp number x, denoting the most typical value  Outputs from a fuzzy system can be:
 Provides a natural way to model some types of – fuzzy, i.e. a whole membership function.
human expertise in a computer program
– exact, i.e. a single value is produced .

241-320 Design Architecture & Fuzzy System 39 241-320 Design Architecture & Fuzzy System 40
Engineering for Intelligent System Engineering for Intelligent System

You might also like