Professional Documents
Culture Documents
Lecture05 (Approximate Reasoning)
Lecture05 (Approximate Reasoning)
University
ASTU
Dept. of EPCE
ASTU
School of EEC
1
1. Approximate Reasoning
• The ultimate goal of fuzzy theory is to
approximate incomplete fuzzy propositions and
obtain new results.
• To achieve this goal, Generalized Modus Ponens
(GMP), Generalized Modus Tollens (GMT), and
Generalized Hypothetical Syllogism (GHS) that
extend classical rules of inference are used.
Contd
(Definition) Generalized MP(GMP)
If A and A' are the fuzzy sets in U, and B and B' in V,
GMP derives a new fuzzy proposition as follows:
fact : if x is A'
rule : if x is A, then y is B
result : y= B'
• If A'= A, then B'= B as classical MP.
• In general, the smaller the difference between A'
and A, the smaller the difference between B' and B
should be.
2
Contd
fact : if x is A'
rule : if x is A, then y is B
result : y is B'
Premise Approximate
(fact) A' reasoning or Result(new fact)
Implication compound rule of
B'= A'(AB)
(rule)AB inference
Contd
fact : if an apple is redish
rule: if the apple is red, then it is ripe
result: The apple is a little ripe
This one is a
Mommy! little ripe.
This apple is Give me
redish. delicious one.
3
Contd
GMP is inferred as follows:
B'=A'(AB)= {(v,B'(v))|vV}
where is an operator that denotes fuzzy composition
Contd
When the sup-min or sup-product operator is used in the
compositional rule of inference, B'(v) is calculated as
• sup-min (Zadeh)
B'(v)= sup[ A ' (u ) A B (u, v)]
uU
• sup-product (Kaufmann)
4
Contd
For example, consider a fuuzy system
fact : service is a little good(A')
rule: if service is good(A), then tip is average(B)
result: your tip is below average(B')
U= 'service'={1,2,3,4,5},V= 'tip'= {0$,2$,5$}
A= 'good'= 0.3/3+1.0/4+0.3/5
B= 'average'= 0.1/0$+ 1.0/2$+0.1/5$
A B
u v
1 2 3 4 5 0 2 5
Contd
A'= 'a little good' A
= 0.3/2+1.0/3+0.3/4
u
1 2 3 4 5
Applying the min operator as fuzzy implication()
results in 1 0
0$ 2$ 5$
2 0
M A 3 0.3 1 0 0 0
4 1.0 2 0 0 0
M A B M A M B 3 0.1 0.3 0.1
5 0.3
4 0.1 1.0 0.1
0$ 2$ 5$
5 0.1 0.3 0.1
M B 0.1 1.0 0.1
5
Contd
sup-min for approximate reasoning
1 2 3 4 5
M A ' 0 0.3 1.0 0.3 0
0$ 2$ 5$
M B ' M A ' M A B 1 0 0 0
2 0 0 0
0 0.3 1.0 0.3 0 3 0.1 0.3 0.1
4 0.1 1.0 0.1
0$ 2$ 5$
5 0.1 0.3 0.1
0.1 0.3 0.1
Contd
sup-product for approximate reasoning
1 2 3 4 5
M A ' 0 0.3 1.0 0.3 0
0$ 2$ 5$
M B ' M A ' M A B 1 0 0 0
2 0 0 0
0 0.3 1.0 0.3 0 3 0.1 0.3 0.1
4 0.1 1.0 0.1
0$ 2$ 5$
5 0.1 0.3 0.1
0.1 0.3 0.1
6
Contd
A if service is good(A),
B
then tip is average(B)
u v
1 2 3 4 5 0 2 5
A' Approximate
A' B'
AB reasoning
A'(AB) B'
u v
1 2 3 4 5 0 2 5
B'= 0.1/0+0.3/2+0.1/5
Service is a little Your tip is below
good(A') average(B')
Contd
(Definition) Generalized MT(GMT)
If A and A' are the fuzzy sets in U, and B and B' in V,
GMT derives a new fuzzy proposition as follows:
fact : if y is B'
rule : if x is A, then y is B
result : x is A'
7
Contd
fact : if y is B'
rule : if x is A, then y is B
result : x is A'
Premise (fact)
B' Approximate Result(new fact)
Implication(rule) reasoning
A'= B'(AB)
AB
Contd
fact : if an apple is not delicious
rule: if an apple is ripe, then it is delicious
result: The apple is not ripe
8
Contd
GMT infers as follows:
A'= B'(AB)= {(u,A'(u))|uU}
where
A'(u)= B'(v)AB(u,v)= sup t[ B ' (v), A B (u, v)]
vV
Contd
For example, consider a fuzzy system
y is B'
if x is A, then y is B
x is A'
where
U= {a,b,c,d,e}, V= {f,g,h}, AU, BV, B'V
B'= 0.1/f+0.5/g+1.0/h
A= 0.3/a+1.0/b+0.3/c+0.1/d
B= 0.2/f+ 1.0/g+0.2/h
9
Contd
From A and B, using the min operator as AB gives
a 0.3
f g h
b 1.0
M B 0.2 1.0 0.2
M A c 0.3
d 0.1
f g h
e 0
a 0.2 0.3 0.2
b 0.2 1.0 0.2
M A B M A M B c 0.2 0.3 0.2
d 0.1 0.1 0.1
e 0 0 0
Contd
Sup-min for approximate reasoning
f g h
M B ' 0.1 0.5 1.0 f g h
a 0.2 0.3 0.2
M A ' M B ' M A B
b 0.2 1.0 0.2
0.1 0.5 1.0 c 0.2 0.3 0.2
d 0.1 0.1 0.1
e 0 0 0
a b c d e
0.3 0.5 0.3 0.1 0
10
Contd
Sup-product for approximate reasoning
f g h
M A ' M B ' M A B a 0.2 0.3 0.2
b 0.2 1.0 0.2
0.1 0.5 1.0 c 0.2 0.3 0.2
d 0.1 0.1 0.1
e 0 0 0
a b c d e
0.2 0.5 0.2 0.1 0
Contd
A B
u v
a b c d e f g h
B' Approximate
A'
AB reasoning
B'(AB)
A'
B'
u
v a b c d e
f g h
11
2. KB and inference Engine
Fuzzy rule base
• A data base stored in the form of a knowledge base,
and is generally composed of fuzzy if-then rules
• A key to fuzzy systems along with fuzzy inference
engine
• Fuzzy rules can be described as MIMO and complex
forms, but simple Mamdani and Sugeno types are
mainly used
• MIMO systems can be represented as a combination
of multi-input single-output (MISO) systems, so
they only deal with MISO fuzzy rules
Contd
Mamdani-type MISO fuzzy rule
R1 : if x1 is A11 and and x n is An1 , then z is C 1 also
R2 : if x1 is A12 and and x n is An2 , then z is C 2 also
Ri : if x1 is A1i and and x n is Ani , then z is C i also
R : if x1 is A1 an d and x n is An , then z is C
12
Contd
Characteristics of Mamdani-type fuzzy rules
• Consequent part is described by a fuzzy set
• Inferred results become fuzzy sets
• In order to apply a Mamdani-type fuzzy rule to
control applications, a defuzzification process is
required to convert the fuzzy set to its
corresponding crisp value.
Contd
2-input 1-output Mamdani-type system
13
Contd
The ith rule Ri can be described as
Contd
Given inputs A and B, the output yields
14
Contd
Lemma 1: ( A ', B ') Ri ( A ', B ') Ri
i 1 i 1
Contd
(1) When inputs A' and B' are fuzzy singletons
A' 1 B' 1
u v
u0 v0
The inferred result is computed according to the
implication and 'and' operators. C ' t[ A ' ( A C ), B ' ( B C )]
i i i i
i 1
C ' {( w , C ' ( w )) | w W }
i Ci ( w )
Ai ( u 0 ) Bi ( v 0 )
C ' ( w ) i 1 , i
Ai ( u 0 ) Bi ( v 0 )
(w)
i 1 i C i
15
Contd
Inference procedure
Step 1: Calculate the truth value of each rule for A'=
u0 and B'= v0.
• If min operator is used for 'and'
1 A1 ( u 0 ) B 1 ( v 0 )
...
A ( u 0 ) B ( v 0 )
• If product operator is used for 'and'
1 A1 ( u 0 ) B 1 ( v 0 )
...
A ( u 0 ) B ( v 0 )
Contd
Step 2: Apply 1,, to the consequent part to
infer each rule.
• If min is used for implication
( w ) 1 C1 ( w )
C1'
...
( w ) C ( w )
C '
• if product is used for implication
( w ) 1 C1 ( w )
C1'
...
( w ) C ( w )
C '
16
Contd
Step 3: Apply the max operator for 'also' to obtain
the final result C'.
C ' {( w , C ' ( w )) | w W }
w here (w) (w) ( w ) ... (w)
C' C1' C 2' C '
Contd
Case1: Mamdani-type inference for fuzzy singleton inputs
input : x1 is A' (u0 ) and x2 is B ' (v0 )
rule R1: if x1 is A1 and x2 is B1, then z is C1 also
rule R2: if x1 is A2 and x2 is B2 , then z is C2
result : z is C '
17
Contd
input : x1 is u0 and x2 is v0
rule R1: if x1 is A1 and x 2 is B1 , then z is C1
1 A1 ( u 0 ) B 1 ( v 0 ) : truth value
( w ) 1 C1 ( w ) : infered value
C1'
Contd
input : x1 is u0 and x2 is v0
rule R2: if x1 is A2 and x2 is B2 , then z is C2
2 A2 ( u 0 ) B 2 ( v 0 )
( w) 2 C2 ( w)
C 2'
18
Contd
Contd
Case2: Mamdani-type inference for fuzzy singleton inputs
input : x1 is A' (u0 ) and x2 is B ' (v0 )
rule R1: if x1 is A1 and x2 is B1 , then z is C1 also
rule R2: if x1 is A2 and x2 is B2 , then z is C2
result : z is C '
19
Contd
input : x1 is u0 and x2 is v0
rule R1: if x1 is A1 and x2 is B1 , then z is C1
1 A1 ( u 0 ) B1 ( v 0 )
( w ) 1 C1 ( w )
C1'
Contd
input : x1 is u0 and x2 is v0
rule R2: if x1 is A2 and x2 is B2 , then z is C2
2 A2 ( u 0 ) B 2 ( v 0 )
( w) 2 C2 ( w)
C 2'
20
Contd
Contd
Example 1: Given a fuzzy system
input : Service is a little good(A') and food is
delicious(B')
rule1: if service is good(A1) and food is good (B1),
then tip is average(C1)
rule2: if service is excellent(A2) and food is
delicious(B2), then tip is generous(C2)
21
Contd
Universes and fuzzy sets
U='service'={1,2,3,4,5},V= 'food'={1,2,3,4,5}
W='tip'= {0$,5$,10$}
A'= 1.0/2 B'= 1.0/5 : fuzzy singletons
A1= 'good'= 0.2/2+1.0/3+0.2/4
A2= 'excellent'= 0.1/3+0.3/4+1.0/5
B1= 'good'= 0.1/2+0.3/3+1.0/4+0.3/5
B2= 'delicious'= 0.1/3+0.3/4+1.0/5
C1= 'average'= 0.1/0$+ 1.0/5$+0.1/10$
C2= 'generous'= 0.1/5$+1.0/10$
implication() and 'and': min operators
'also' : max operator
Contd
Given A'= u0= 2, B'= v0= 5, C'1 yields
A1 B1 C1
u v w
12345 123 4 5 0 5 10
u0 v0
C'1
1 A1 (2) B 1 (5)
0.2 0.3 0.2 w
0 5 10
( w ) 1 C1 ( w )
C1'
= 0.1/0$+ 0.2/5$+0.1/10$
22
Contd
Given A'= u0= 2 and B'= v0= 5, C'2 yields
A2 B2 C2
u v w
12345 12 345 0 5 10
u0 v0
C'2
2 A2 (2) B 2 (5) 0 1 0
(w) 2 C2 (w)
w
C 2'
0 5 10
=
Contd
C'1 C'2 yields
C'1
w C'
0 5 10
C'2 w
0 5 10
w
0 5 10 C ' ( w ) = 0.1/0$+ 0.2/5$+0.1/10$
23
Contd
(2) When inputs A' and B' are fuzzy sets
1
A' B' 1
u v
The inferred result depends on the use of operators.
C ' t [ A ' ( Ai C i ), B ' ( Bi C i )]
i 1
Contd
Applying sup-min operator for
composition gives
C ' {( w , C ' ( w )) | w W }
i i Ci ( w )
1
C ' (w) ,
(w)
i 1 i C i
[ ( Ai ( u ) ' ( u ))] [( Bi ( v ) ' ( v ))]
A v B
i u
[ ( Ai ( u ) A ' ( u ))] [( v Bi ( v ) B ' ( v ))]
u
24
Contd
Inference procedure
Step 1: Calculate A'Ai and B'Bi of each rule.
• If sup-min is used for composition
( A1 ( u ) ( u )), ..., ( A ( u ) ( u ))
u A' u A'
( B1 ( v ) ( v )), ..., ( B ( v ) ( v ))
v B' v B'
( B1 ( v ) ( v )), ..., ( B ( v ) ( v ))
v B' v B'
Contd
Step 2: Calculate the truth value of each rule for A',
B'.
• If min operator is used for 'and'
1 [ ( A1 ( u ) ' ( u ))] [( B1 ( v ) ' ( v ))], ...,
u A v B
25
Contd
Step 3: Apply 1,, to the consequent part to
infer each rule.
• if min is used for implication
( w ) 1 C1 ( w ), ...
C1'
( w ) C ( w )
C '
Contd
Step 4: Apply the max operator for 'also' to obtain
the final result C'.
C ' {( w , C ' ( w )) | w W }
(w) (w) ( w ) ... (w)
C' C1' C 2' C '
26
Contd
Case 3: Mamdani-type inference for fuzzy set inputs
input : x1 is A' and x2 is B '
rule R1: if x1 is A1 and x2 is B1, then z is C1 also
rule R2: if x1 is A2 and x2 is B2 , then z is C2
result : z is C '
where AiU, BiV, CiW, uU, vV, wW
A' and B' : fuzzy sets
composition: sup-min
implication and 'and': min operators
'also' : max operator
Contd
input : x1 is A' and x2 is B '
rule R1: if x1 is A1 and x2 is B1 , then z is C1
( w ) 1 C1 ( w )
C1'
27
Contd
input : x1 is A' and x2 is B '
rule R2: if x1 is A2 and x2 is B2 , then z is C2
(w) 2 C2 ( w)
C 2'
Contd
28
Contd
Case 4: Mamdani-type inference for fuzzy set inputs
input : x1 is A' and x2 is B '
rule R1: if x1 is A1 and x2 is B1, then z is C1 also
rule R2: if x1 is A2 and x2 is B2 , then z is C2
result : z is C '
where AiU, BiV, CiW, uU, vV, wW
A' and B' : fuzzy sets
composition: sup-min
implication: product operator
'and': min operator
'also': max operator
Contd
input : x1 is A' and x2 is B '
rule R1: if x1 is A1 and x2 is B1, then z is C1
1 [ ( A1 ( u ) ( u ))] [( B1 ( v ) ( v ))]
u A' v B'
( w ) 1 C1 ( w )
C1'
29
Contd
input : x1 is u0 and x2 is v0
rule R2: if x1 is A2 and x2 is B2 , then z is C2
Contd
30
Contd
Sugeno-type MISO fuzzy rule
R1 : if x1 is A11 and and x n is An1 , then z f1 ( x1 , ..., x n )
R2 : if x1 is A12 and and x n is An2 , then z f 2 ( x1 ,..., x n )
Ri : if x1 is A1i and and x n is Ani , then z = f i ( x1 , ..., x n )
R : if x1 is A1 and and x n is An , then z f ( x1 ,..., x n )
Contd
Characteristics of Sugeno-type fuzzy rules
31
Contd
2-input 1-output Sugeno-type
input : x1 is u0 and x2 is v0
rule R1: if x1 is A1 and x2 is B1, then z f1 ( x1 , x2 )
rule Ri: if x1 is Ai and x2 is Bi , then z f 2 ( x1 , x2 )
rule R: if x1 is A and x2 is A , then z f ( x1, x2 )
result : z = w0
where AiU, BiV, CiW, uU, vV, wW
Contd
Inference procedure
Step 1: Calculate the truth value of each rule for A'=
u0 and B'= v0.
• If min operator is used for 'and'
1 A1 ( u 0 ) B1 ( v 0 ), ...,
A ( u 0 ) B ( v 0 )
• If product operator is used for 'and'
1 A1 ( u 0 ) B1 ( v 0 ), ...,
A ( u 0 ) B ( v 0 )
32
Contd
Step 2: Calculate fi(x1,x2) of each rule with the inputs
x1= u0 and x2= v0.
1 f1 ( u 0 , v 0 ) 2 f 2 ( u 0 , v 0 ) ... f ( u 0 , v 0 )
z
1 2 ...
Contd
Given x1= u0 and x2= v0, the final result for two rules
can be calculated by
1 f1 ( u 0 , v 0 ) 2 f 2 ( u 0 , v 0 )
z
1 2
33
Contd
Example 2: 2-input, 1-output Sugeno-type fuzzy
system
Inputs: x= 1, y= -0.5
R1: if x is A1 and y is B1, then z= -x+2y+1
R2: if x is A2 and y is B1, then z= -y+2
R3: if x is A1 and y is B2, then z= -x+2
R4: if x is A2 and y is B2, then z= x+2y+1
Contd
From the input and the MFs
1= 0.10.7= 0.1, 2= 0.80.7= 0.7,
3= 0.10.3= 0.1, 4= 0.80.3= 0.3
z1= -x+2y+1= -1
z2= -y+2= 2.5
z3= -x+2= 1
z4= x+2y+1= 1
1 z1 2 z 2 3 z 3 4 z 4 2.05
z 1.708
1 2 3 4 1.2
34
Q&A
35