Staff Site Universitas Negeri Yogyakarta fuzzy rule ii
Sistem Cerdas : PTK – Pasca Sarjana - UNY
Fuzzy Rules & Fuzzy Reasoning
Pengampu: Fatchul Arifin
Referensi:
Jyh-Shing Roger Jang et al., Neuro-Fuzzy and Soft Computing: A Computational
Approach to Learning and Machine Intelligence, First Edition, Prentice Hall, 1997
22
Fuzzy if-then rules (3.3) (cont.)
– Orthogonality
A term set T = t1,…, tn of a linguistic variable x on
the universe X is orthogonal if:
t i ( x) 1,
n
i 1
x X
Where the ti’s are convex & normal fuzzy sets
defined on X.
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
23
Fuzzy if-then rules (3.3) (cont.)
General format:
– If x is A then y is B (where A & B are linguistic values
defined by fuzzy sets on universes of discourse X &
Y).
• “x is A” is called the antecedent or premise
• “y is B” is called the consequence or conclusion
– Examples:
•
•
•
•
Dr. Djamel Bouchaffra
If pressure is high, then volume is small.
If the road is slippery, then driving is dangerous.
If a tomato is red, then it is ripe.
If the speed is high, then apply the brake a little.
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
24
Fuzzy if-then rules (3.3) (cont.)
– Meaning of fuzzy if-then-rules (A B)
• It is a relation between two variables x & y; therefore it is
a binary fuzzy relation R defined on X * Y
• There are two ways to interpret A B:
– A coupled with B
– A entails B
if A is coupled with B then:
R A B A*B
A ( x) * B ( y ) /( x, y )
~
X* Y
~
where * is a T - normoperator.
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
25
Fuzzy if-then rules (3.3) (cont.)
If A entails B then:
R = A B = A B ( material implication)
R = A B = A (A B) (propositional calculus)
R = A B = ( A B) B (extended propositional
calculus)
~
R ( x, y ) sup c; A ( x ) * c B ( y ),0 c 1
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
26
Fuzzy if-then rules (3.3) (cont.)
Two ways to interpret “If x is A then y is B”:
A coupled with B
y
y
A entails B
B
B
x
A
Dr. Djamel Bouchaffra
x
A
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
27
Fuzzy if-then rules (3.3) (cont.)
• Note that R can be viewed as a fuzzy set with a
two-dimensional MF
R(x, y) = f(A(x), B(y)) = f(a, b)
With a = A(x), b = B(y) and f called the fuzzy
implication function provides the membership
value of (x, y)
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
28
Fuzzy if-then rules (3.3) (cont.)
– Case of “A coupled with B”
Rm A * B
A
( x) B ( y ) /( x, y )
X *Y
(minimum operator proposed by Mamdani, 1975)
Rp A * B
A ( x) B ( y ) /( x, y )
X* Y
(product proposed by Larsen, 1980)
R bp A * B
A ( x) B ( y ) /( x, y )
0 ( A (x) B (y ) 1) /( x, y )
X* Y
X*Y
(bounded product operator)
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
29
Fuzzy if-then rules (3.3) (cont.)
– Case of “A coupled with B” (cont.)
Rdp A * B
A
( x) ˆ. B ( y ) /( x, y )
a if b 1
where : f(a, b) a ˆ. b b if a 1
0 if otherwise
X *Y
Example for A ( x) bell ( x;4,3,10) and B ( y ) bell ( y;4,3,10)
(Drastic operator)
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
30
Fuzzy if-then rules (3.3) (cont.)
A coupled with B
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
31
Fuzzy if-then rules (3.3) (cont.)
– Case of “A entails B”
R a A B
1 (1 A ( x) B ( y ) /( x, y )
where : f a (a, b ) 1 (1 a b )
X*Y
(Zadeh’s arithmetic rule by using bounded sum operator for union)
R mm A ( A B )
(1 A ( x)) ( A ( x) B ( y )) /( x, y )
where : f m (a, b ) (1 a ) (a b )
X*Y
(Zadeh’s max-min rule)
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
32
Fuzzy if-then rules (3.3) (cont.)
– Case of “A entails B” (cont.)
R s A B
(1 A ( x)) B ( y ) /( x, y )
where : f s (a, b ) (1 a ) b
X*Y
(Boolean fuzzy implication with max for union)
R
~ ( y )) /( x, y )
(
(
x
)
A
B
if a b
1
~
where : a b
b / a otherwise
X*Y
(Goguen’s fuzzy implication with algebraic product for
T-norm)
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
33
A entails B
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
34
Fuzzy Reasoning (3.4)
Definition
– Known also as approximate reasoning
– It is an inference procedure that derives
conclusions from a set of fuzzy if-then-rules &
known facts
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
35
Fuzzy Reasoning (3.4) (cont.)
Compositional rule of inference
– Idea of composition (cylindrical extension &
projection)
• Computation of b given a & f isthe goal of the composition
– Image of a point is a point
– Image of an interval is an interval
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
36
Fuzzy Reasoning (3.4) (cont.)
Derivation of y = b from x = a and y = f(x):
y
y
b
b
y = f(x)
y = f(x)
a
a and b: points
y = f(x) : a curve
Dr. Djamel Bouchaffra
x
x
a
a and b: intervals
y = f(x) : an interval-valued
function
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
37
Fuzzy Reasoning (3.4) (cont.)
– The extension principle is a special case of
the compositional rule of inference
• F is a fuzzy relation on X*Y, A is a fuzzy set of X
& the goal is to determine the resulting fuzzy set
B
– Construct a cylindrical extension c(A) with base A
– Determine c(A) F (using minimum operator)
– Project c(A) F onto the y-axis which provides B
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
38
Fuzzy Reasoning (3.4) (cont.)
a is a fuzzy set and y = f(x) is a fuzzy relation:
Dr. Djamel Bouchaffra
cri.m
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
39
Fuzzy Reasoning (3.4) (cont.)
Given A, A B, infer B
A = “today is sunny”
A B: day = sunny then sky = blue
infer: “sky is blue”
• illustration
Dr. Djamel Bouchaffra
Premise 1 (fact):
Premise 2 (rule):
x is A
if x is A then y is B
Consequence:
y is B
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
40
Fuzzy Reasoning (3.4) (cont.)
Approximation
A’ = “ today is more or less sunny”
B’ = “ sky is more or less blue”
• iIlustration
Premise 1 (fact):
Premise 2 (rule):
x is A’
if x is A then y is B
Consequence:
y is B’
(approximate reasoning or fuzzy reasoning!)
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
41
Fuzzy Reasoning (3.4) (cont.)
Definition of fuzzy reasoning
Let A, A’ and B be fuzzy sets of X, X, and Y,
respectively. Assume that the fuzzy implication
A B is expressed as a fuzzy relation R on X*Y. Then
the fuzzy set B induced by “x is A’ ” and the fuzzy rule
“if x is A then y is B’ is defined by:
B' ( y ) max min A' ( x ), R ( x, y )
x
Single rule with single antecedent
Rule : if x is A then y is B
Fact: x is A’
Conclusion: y is B’ (B’(y) = [x (A’(x) A(x)] B(y))
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
42
Fuzzy Reasoning (3.4) (cont.)
A’
A
B
w
Y
X
A’
B’
X
x is A’
Dr. Djamel Bouchaffra
Y
y is B’
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
43
– Single rule with multiple antecedents
Premise 1 (fact): x is A’ and y is B’
Premise 2 (rule): if x is A and y is B then z is C
Conclusion: z is C’
Premise 2: A*B C
R mamdani ( A , B , C ) ( A * B ) * C
C' ( A'*B' ) ( A * B C )
A ( x ) B ( y ) C ( z ) /( x, y , z )
X* Y * Z
C' ( z ) A ' ( x ) B ' ( y ) A ( x ) B ( y ) C ( z )
premise 1
premise 2
A ' ( x ) B ' ( y ) A ( x ) B ( y ) C ( z )
x ,y
A ' ( x ) A ( x ) B ' ( y ) B ( y ) C ( z )
x
y
x ,y
(w 1 w 2 ) C ( z )
w1
Dr. Djamel Bouchaffra
w2
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
44
T-norm
A’ A
B’ B
C2
w1
w
w2
Z
X
A’
Y
B’
C’
Z
x is A’
Dr. Djamel Bouchaffra
X
y is B’
Y
z is C’
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
45
Fuzzy Reasoning (3.4) (cont.)
– Multiple rules with multiple antecedents
Premise 1 (fact): x is A’ and y is B’
Premise 2 (rule 1): if x is A1 and y is B1 then z is C1
Premise 3 (rule 2): If x is A2 and y is B2 then z is C2
Consequence (conclusion): z is C’
R1 = A1 * B1 C1
R2 = A2 * B2 C2
Since the max-min composition operator o is distributive over the union
operator, it follows:
C’ = (A’ * B’) o (R1 R2) = [(A’ * B’) o R1] [(A’ * B’) o R2] = C’1 C’2
Where C’1 & C’2 are the inferred fuzzy set for rules 1 & 2 respectively
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
46
A’
A1
B’ B1
C1
w1
Z
X
A’ A2
Y
B’ B2
C2
w2
Z
X
Y
T-norm
A’
B’
C’
Z
x is A’
Dr. Djamel Bouchaffra
X
y is B’
Y
z is C’
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
Fuzzy Rules & Fuzzy Reasoning
Pengampu: Fatchul Arifin
Referensi:
Jyh-Shing Roger Jang et al., Neuro-Fuzzy and Soft Computing: A Computational
Approach to Learning and Machine Intelligence, First Edition, Prentice Hall, 1997
22
Fuzzy if-then rules (3.3) (cont.)
– Orthogonality
A term set T = t1,…, tn of a linguistic variable x on
the universe X is orthogonal if:
t i ( x) 1,
n
i 1
x X
Where the ti’s are convex & normal fuzzy sets
defined on X.
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
23
Fuzzy if-then rules (3.3) (cont.)
General format:
– If x is A then y is B (where A & B are linguistic values
defined by fuzzy sets on universes of discourse X &
Y).
• “x is A” is called the antecedent or premise
• “y is B” is called the consequence or conclusion
– Examples:
•
•
•
•
Dr. Djamel Bouchaffra
If pressure is high, then volume is small.
If the road is slippery, then driving is dangerous.
If a tomato is red, then it is ripe.
If the speed is high, then apply the brake a little.
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
24
Fuzzy if-then rules (3.3) (cont.)
– Meaning of fuzzy if-then-rules (A B)
• It is a relation between two variables x & y; therefore it is
a binary fuzzy relation R defined on X * Y
• There are two ways to interpret A B:
– A coupled with B
– A entails B
if A is coupled with B then:
R A B A*B
A ( x) * B ( y ) /( x, y )
~
X* Y
~
where * is a T - normoperator.
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
25
Fuzzy if-then rules (3.3) (cont.)
If A entails B then:
R = A B = A B ( material implication)
R = A B = A (A B) (propositional calculus)
R = A B = ( A B) B (extended propositional
calculus)
~
R ( x, y ) sup c; A ( x ) * c B ( y ),0 c 1
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
26
Fuzzy if-then rules (3.3) (cont.)
Two ways to interpret “If x is A then y is B”:
A coupled with B
y
y
A entails B
B
B
x
A
Dr. Djamel Bouchaffra
x
A
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
27
Fuzzy if-then rules (3.3) (cont.)
• Note that R can be viewed as a fuzzy set with a
two-dimensional MF
R(x, y) = f(A(x), B(y)) = f(a, b)
With a = A(x), b = B(y) and f called the fuzzy
implication function provides the membership
value of (x, y)
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
28
Fuzzy if-then rules (3.3) (cont.)
– Case of “A coupled with B”
Rm A * B
A
( x) B ( y ) /( x, y )
X *Y
(minimum operator proposed by Mamdani, 1975)
Rp A * B
A ( x) B ( y ) /( x, y )
X* Y
(product proposed by Larsen, 1980)
R bp A * B
A ( x) B ( y ) /( x, y )
0 ( A (x) B (y ) 1) /( x, y )
X* Y
X*Y
(bounded product operator)
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
29
Fuzzy if-then rules (3.3) (cont.)
– Case of “A coupled with B” (cont.)
Rdp A * B
A
( x) ˆ. B ( y ) /( x, y )
a if b 1
where : f(a, b) a ˆ. b b if a 1
0 if otherwise
X *Y
Example for A ( x) bell ( x;4,3,10) and B ( y ) bell ( y;4,3,10)
(Drastic operator)
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
30
Fuzzy if-then rules (3.3) (cont.)
A coupled with B
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
31
Fuzzy if-then rules (3.3) (cont.)
– Case of “A entails B”
R a A B
1 (1 A ( x) B ( y ) /( x, y )
where : f a (a, b ) 1 (1 a b )
X*Y
(Zadeh’s arithmetic rule by using bounded sum operator for union)
R mm A ( A B )
(1 A ( x)) ( A ( x) B ( y )) /( x, y )
where : f m (a, b ) (1 a ) (a b )
X*Y
(Zadeh’s max-min rule)
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
32
Fuzzy if-then rules (3.3) (cont.)
– Case of “A entails B” (cont.)
R s A B
(1 A ( x)) B ( y ) /( x, y )
where : f s (a, b ) (1 a ) b
X*Y
(Boolean fuzzy implication with max for union)
R
~ ( y )) /( x, y )
(
(
x
)
A
B
if a b
1
~
where : a b
b / a otherwise
X*Y
(Goguen’s fuzzy implication with algebraic product for
T-norm)
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
33
A entails B
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
34
Fuzzy Reasoning (3.4)
Definition
– Known also as approximate reasoning
– It is an inference procedure that derives
conclusions from a set of fuzzy if-then-rules &
known facts
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
35
Fuzzy Reasoning (3.4) (cont.)
Compositional rule of inference
– Idea of composition (cylindrical extension &
projection)
• Computation of b given a & f isthe goal of the composition
– Image of a point is a point
– Image of an interval is an interval
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
36
Fuzzy Reasoning (3.4) (cont.)
Derivation of y = b from x = a and y = f(x):
y
y
b
b
y = f(x)
y = f(x)
a
a and b: points
y = f(x) : a curve
Dr. Djamel Bouchaffra
x
x
a
a and b: intervals
y = f(x) : an interval-valued
function
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
37
Fuzzy Reasoning (3.4) (cont.)
– The extension principle is a special case of
the compositional rule of inference
• F is a fuzzy relation on X*Y, A is a fuzzy set of X
& the goal is to determine the resulting fuzzy set
B
– Construct a cylindrical extension c(A) with base A
– Determine c(A) F (using minimum operator)
– Project c(A) F onto the y-axis which provides B
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
38
Fuzzy Reasoning (3.4) (cont.)
a is a fuzzy set and y = f(x) is a fuzzy relation:
Dr. Djamel Bouchaffra
cri.m
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
39
Fuzzy Reasoning (3.4) (cont.)
Given A, A B, infer B
A = “today is sunny”
A B: day = sunny then sky = blue
infer: “sky is blue”
• illustration
Dr. Djamel Bouchaffra
Premise 1 (fact):
Premise 2 (rule):
x is A
if x is A then y is B
Consequence:
y is B
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
40
Fuzzy Reasoning (3.4) (cont.)
Approximation
A’ = “ today is more or less sunny”
B’ = “ sky is more or less blue”
• iIlustration
Premise 1 (fact):
Premise 2 (rule):
x is A’
if x is A then y is B
Consequence:
y is B’
(approximate reasoning or fuzzy reasoning!)
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
41
Fuzzy Reasoning (3.4) (cont.)
Definition of fuzzy reasoning
Let A, A’ and B be fuzzy sets of X, X, and Y,
respectively. Assume that the fuzzy implication
A B is expressed as a fuzzy relation R on X*Y. Then
the fuzzy set B induced by “x is A’ ” and the fuzzy rule
“if x is A then y is B’ is defined by:
B' ( y ) max min A' ( x ), R ( x, y )
x
Single rule with single antecedent
Rule : if x is A then y is B
Fact: x is A’
Conclusion: y is B’ (B’(y) = [x (A’(x) A(x)] B(y))
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
42
Fuzzy Reasoning (3.4) (cont.)
A’
A
B
w
Y
X
A’
B’
X
x is A’
Dr. Djamel Bouchaffra
Y
y is B’
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
43
– Single rule with multiple antecedents
Premise 1 (fact): x is A’ and y is B’
Premise 2 (rule): if x is A and y is B then z is C
Conclusion: z is C’
Premise 2: A*B C
R mamdani ( A , B , C ) ( A * B ) * C
C' ( A'*B' ) ( A * B C )
A ( x ) B ( y ) C ( z ) /( x, y , z )
X* Y * Z
C' ( z ) A ' ( x ) B ' ( y ) A ( x ) B ( y ) C ( z )
premise 1
premise 2
A ' ( x ) B ' ( y ) A ( x ) B ( y ) C ( z )
x ,y
A ' ( x ) A ( x ) B ' ( y ) B ( y ) C ( z )
x
y
x ,y
(w 1 w 2 ) C ( z )
w1
Dr. Djamel Bouchaffra
w2
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
44
T-norm
A’ A
B’ B
C2
w1
w
w2
Z
X
A’
Y
B’
C’
Z
x is A’
Dr. Djamel Bouchaffra
X
y is B’
Y
z is C’
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
45
Fuzzy Reasoning (3.4) (cont.)
– Multiple rules with multiple antecedents
Premise 1 (fact): x is A’ and y is B’
Premise 2 (rule 1): if x is A1 and y is B1 then z is C1
Premise 3 (rule 2): If x is A2 and y is B2 then z is C2
Consequence (conclusion): z is C’
R1 = A1 * B1 C1
R2 = A2 * B2 C2
Since the max-min composition operator o is distributive over the union
operator, it follows:
C’ = (A’ * B’) o (R1 R2) = [(A’ * B’) o R1] [(A’ * B’) o R2] = C’1 C’2
Where C’1 & C’2 are the inferred fuzzy set for rules 1 & 2 respectively
Dr. Djamel Bouchaffra
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning
46
A’
A1
B’ B1
C1
w1
Z
X
A’ A2
Y
B’ B2
C2
w2
Z
X
Y
T-norm
A’
B’
C’
Z
x is A’
Dr. Djamel Bouchaffra
X
y is B’
Y
z is C’
CSE 513 Soft Computing, Ch. 3: Fuzzy rules & fuzzy reasoning