Title: FLEA
1FLEA
- Prof. dr. ir. J. Hellendoorn
2Situation of more rules
R1 if A1 then B1
R2 if A2 then B2
R3 if A3 then B3
Rn if An then Bn
Suppose A, what is B?
3The two main inference rules
Mamdani
Gödel
4Global inference, Mamdani
- Ri if Ai(x) then Bi(y), given A(x)
- Mamdani
- B (y) A(x) o Rm
5Global inference, Gödel
- Ri if Ai(x) then Bi(y), given A(x)
- Gödel
- B (y) A(x) o Rm
6Different cases
- A(x) Ai(x)
- A(x) Ai(x)? Ai1(x)
- A(x) Ai(x)? Ai1(x)
- A(x) Ai(x)? Ak(x)
- A(x) Ai(x)? Ak(x)
- A(x) ? Ai(x)
- A(x) ? Ai(x)
- A(x) ?Ai(x)
- A(x) Ai½(x)
- A(x) unknown
- A(x) undefined
7Example Fuzzy Sets
x1, x2, x3, x4, x5, x6, x7
A1(x) (1.0, 0.8, 0.6, 0.4, 0.2, 0.0, 0.0)
A2(x) (0.0, 0.4, 0.8, 1.0, 0.8, 0.4, 0.0)
A3(x) (0.0, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0)
y1, y2, y3, y4, y5, y6, y7
B1(y) (1.0, 0.9, 0.7, 0.5, 0.3, 0.0, 0.0)
B2(y) (0.0, 0.5, 0.7, 1.0, 0.7, 0.5, 0.0)
B3(y) (0.0, 0.0, 0.3, 0.5, 0.7, 0.9, 1.0)
8Example Rule Base
R1 if A1(x) then B1(y)
R2 if A2(x) then B2(y)
R3 if A3(x) then B3(y)
9Meaning of rule 1, Mamdani
R1 if A1(x) then B1(y)
10Meaning of rule 1, Gödel
R1 if A1(x) then B1(y)
11Meaning of rule 2, Mamdani
R2 if A2(x) then B2(y)
12Meaning of rule 2, Gödel
R2 if A2(x) then B2(y)
13Meaning of rule 3, Mamdani
R3 if A3(x) then B3(y)
14Meaning of rule 3, Gödel
R3 if A3(x) then B3(y)
15Three Mamdani-rules together
16Global meaning, Mamdani
17Three Gödel-rules together
18Global meaning, Gödel
19Example Fuzzy Sets (repeat)
x1, x2, x3, x4, x5, x6, x7
A1(x) (1.0, 0.8, 0.6, 0.4, 0.2, 0.0, 0.0)
A2(x) (0.0, 0.4, 0.8, 1.0, 0.8, 0.4, 0.0)
A3(x) (0.0, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0)
y1, y2, y3, y4, y5, y6, y7
B1(y) (1.0, 0.9, 0.7, 0.5, 0.3, 0.0, 0.0)
B2(y) (0.0, 0.5, 0.7, 1.0, 0.7, 0.5, 0.0)
B3(y) (0.0, 0.0, 0.3, 0.5, 0.7, 0.9, 1.0)
20Case 1, A A1
- A A1 (1, 0.8, 0.6, 0.4, 0.2, 0, 0)
- Expect B B1 (1, 0.9, 0.7, 0.5, 0.3, 0, 0)
- B A1 o Rm (1, 0.9, 0.7, 0.6, 0.6, 0.5, 0.4)
- B A1 o Rg (1, 0.9, 0.7, 0.5, 0.3, 0, 0)
- Mamdani B ? Bi
- Gödel B ? Bi
21Case 2, A A1 ? A2
- A A1 ? A2 (1, 0.8, 0.8, 1, 0.8, 0.4, 0)
- Expect B B1 ? B2 (1, 0.9, 0.7, 1, 0.7, 0.5,
0) - B (A1?A2) o Rm (1, 0.9, 0.7, 1, 0.7, 0.6,
0.6) - B (A1?A2) o Rg (1, 0.9, 0.7, 1, 0.7, 0.4, 0)
- Mamdani B ? B1 ? B2
- Gödel B ? B1 ? B2
22Case 3, A A1 ? A2
- A A1 ? A2 (0, 0.4, 0.6, 0.4, 0.2, 0, 0)
- Expect B B1 ? B2 (0, 0.5, 0.7, 0.5, 0.3, 0,
0) - B (A1 ? A2) o Rm (0.6, 0.6, 0.6, 0.6, 0.6,
0.5, 0.4) - B (A1 ? A2) o Rg (0, 0.4, 0.6, 1, 0.5, 0.3,
0) - Mamdani B ? B1 ? B2
- Gödel B ? B1 ? B2
23Case 3, A A1 ? A2 normalized
- A A1 ? A2 (0, 0.7, 1, 0.7, 0.3, 0, 0)
- Expect B B1 ? B2 (0, 0.8, 1, 0.8, 0.3, 0,
0) - B (A1 ? A2) o Rm (0.7, 0.7, 0.7, 0.8, 0.7,
0.5, 0.4) - B (A1 ? A2) o Rg (0, 0.7, 0.7, 0.7, 0.3, 0,
0) - Mamdani B ? B1 ? B2
- Gödel B ? B1 ? B2
24Case 4, A A1 ? A3
- A A1 ? A3 (1, 0.8, 0.6, 0.4, 0.6, 0.8, 1)
- Expect B B1 ? B3 (1, 0.9, 0.7, 0.5, 0.7,
0.9, 1) - B (A1?A3) o Rm (1, 0.9, 0.7, 0.6, 0.7, 0.9,
1) - B (A1?A3) o Rg (1, 0.9, 0.7, 0.5, 0.7, 0.9,
1) - Mamdani B ? B1 ? B3
- Gödel B ? B1 ? B3
25Case 5, A A1 ? A3
- A A1 ? A3 (0, 0, 0.2, 0.4, 0.2, 0, 0)
- Expect B B1 ? B3 (0, 0, 0.3, 0.5, 0.3, 0,
0) - B (A1 ? A3) o Rm (0.4, 0.4, 0.4, 0.4, 0.4,
0.4, 0.4) - B (A1 ? A3) o Rg (0, 0, 0.3, 0.4, 0.3, 0, 0)
- Mamdani B ? B1 ? B3
- Gödel B ? B1 ? B3
26Case 6, A ? A1
- A (1, 0.6, 0.4, 0.2, 0, 0, 0) ? (1, 0.8, 0.6,
0.4, 0.2, 0, 0) - Expect B ? B1 (1, 0.9, 0.7, 0.5, 0.3, 0, 0)
- B A o Rm (1, 0.9, 0.7, 0.5, 0.4, 0.4, 0.2)
- B A o Rg (1, 0.9, 0.7, 0.5, 0.3, 0, 0)
- Mamdani B ? B1
- Gödel B B1
27Case 7, A ? A1
- A (1, 1, 0.8, 0.6, 0.4, 0.2, 0) ? (1, 0.8,
0.6, 0.4, 0.2, 0, 0) - Expect B ? B1 (1, 0.9, 0.7, 0.5, 0.3, 0, 0)
- B A o Rm (1, 0.9, 0.7, 0.8, 0.7, 0.5, 0.4)
- B A o Rg (1, 1, 0.7, 0.6, 0.4, 0.2, 0)
- Mamdani B ? B1
- Gödel B ? B1
28Case 8, A ?A1
- A ?A1 (0, 0.2, 0.4, 0.6, 0.8, 1, 1)
- Expect B? B1 (0, 0.1, 0.3, 0.5, 0.7, 1, 1)
- B A o Rm (0.4, 0.5, 0.7, 0.8, 0.7, 0.9, 1)
- B A o Rg (0, 0.2, 0.4, 0.6, 0.7, 1, 1)
- Mamdani B ? ? B1
- Gödel B ? ? B1
29Case 9, A A1½
- A A1 ½ (1, 0.64, 0.36, 0.16, 0.04, 0, 0)
- Expect B B1 ½ (1, 0.81, 0.49, 0.25, 0.09, 0,
0) - B A o Rm (1, 0.9, 0.7, 0.5, 0.4, 0.4, 0.2)
- B A o Rg (1, 0.9, 0.7, 0.5, 0.3, 0, 0)
- Mamdani B ? B1 ½
- Gödel B ? B1 ½
30Case 10, A unknown
- A unknown (1, 1, 1, 1, 1, 1, 1)
- Expect B unknown (1, 1, 1, 1, 1, 1, 1, 1)
- B A o Rm (1, 0.9, 0.7, 1, 0.7, 0.9, 1)
- B A o Rg (1, 1, 0.7, 1, 0.7, 1, 1)
- Mamdani B ? unknown
- Gödel B ? unknown
31Case 11, A undefined
- A undefined (0, 0, 0, 0, 0, 0, 0)
- Expect B undefined (0, 0, 0, 0, 0, 0, 0)
- B A o Rm (0, 0, 0, 0, 0, 0, 0)
- B A o Rg (0, 0, 0, 0, 0, 0, 0)
- Mamdani B undefined
- Gödel B undefined
32Global inference
- Ri if Ai(x) then Bi(y), given A(x)
- Mamdani
- Gödel
- B (y) A(x) o Rm or B (y) A(x) o Rg
33Local inference
- Ri if Ai(x) then Bi(y), given A(x)
- Mamdani Bi(y) A(x) o Rim
- B(y) ?i Bi(y)
- Gödel Bi(y) A(x) o Rig
- B(y) ?i Bi(y)
34Example Fuzzy Sets (repeat)
x1, x2, x3, x4, x5, x6, x7
A1(x) (1.0, 0.8, 0.6, 0.4, 0.2, 0.0, 0.0)
A2(x) (0.0, 0.4, 0.8, 1.0, 0.8, 0.4, 0.0)
A3(x) (0.0, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0)
y1, y2, y3, y4, y5, y6, y7
B1(y) (1.0, 0.9, 0.7, 0.5, 0.3, 0.0, 0.0)
B2(y) (0.0, 0.5, 0.7, 1.0, 0.7, 0.5, 0.0)
B3(y) (0.0, 0.0, 0.3, 0.5, 0.7, 0.9, 1.0)
35Example Rule Base (repeat)
R1 if A1(x) then B1(y)
R2 if A2(x) then B2(y)
R3 if A3(x) then B3(y)
36Mamdani-local, A A1(x)
x1, x2, x3, x4, x5, x6, x7
A A1(x) (1.0, 0.8, 0.6, 0.4, 0.2, 0.0, 0.0)
y1, y2, y3, y4, y5, y6, y7
B1(y) (1.0, 0.9, 0.7, 0.5, 0.3, 0.0, 0.0)
B2 (y) (0.0, 0.5, 0.6, 0.6, 0.6, 0.5, 0.0)
B3 (y) (0.0, 0.0, 0.3, 0.4, 0.4, 0.4, 0.4)
B(y) ?i Bi(y) (1.0, 0.9, 0.7, 0.6, 0.6,
0.5, 0.4)
Compare to A o Rm (1.0, 0.9, 0.7, 0.6, 0.6,
0.5, 0.4)
37Gödel-local , A A1(x)
x1, x2, x3, x4, x5, x6, x7
A A1(x) (1.0, 0.8, 0.6, 0.4, 0.2, 0.0, 0.0)
y1, y2, y3, y4, y5, y6, y7
B1(y) (1.0, 0.9, 0.7, 0.5, 0.3, 0.0, 0.0)
B2 (y) (1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
B3 (y) (1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
B(y) ?i Bi(y) (1.0, 0.9, 0.7, 0.5, 0.3,
0.0, 0.0)
Compare to A o Rg (1.0, 0.9, 0.7, 0.5, 0.3,
0.0, 0.0)
38Mamdani-local, A A1(x) ? A2(x)
x1, x2, x3, x4, x5, x6, x7
A A1(x) ? A2(x) (1.0, 0.8, 0.8, 1.0, 0.8,
0.4, 0.0)
y1, y2, y3, y4, y5, y6, y7
B1(y) (1.0, 0.9, 0.7, 0.5, 0.3, 0.0, 0.0)
B2 (y) (0.0, 0.5, 0.7, 1.0, 0.7, 0.5, 0.0)
B3 (y) (0.0, 0.0, 0.3, 0.5, 0.6, 0.6, 0.6)
B(y) ?i Bi(y) (1.0, 0.9, 0.7, 1.0, 0.7,
0.6, 0.6)
Compare to (A1(x) ? A2(x)) o Rm (1.0, 0.9,
0.7, 1.0, 0.7, 0.6, 0.6)
39Gödel-local, A A1(x) ? A2(x)
x1, x2, x3, x4, x5, x6, x7
A A1(x) ? A2(x) (1.0, 0.8, 0.8, 1.0, 0.8,
0.4, 0.0)
y1, y2, y3, y4, y5, y6, y7
B1(y) (1.0, 1.0, 1.0, 1.0, 0.8, 0.4, 0.4)
B2 (y) (1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
B3 (y) (1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
B(y) ?i Bi(y) (1.0, 1.0, 1.0, 1.0, 0.8,
0.4, 0.4)
Compare to (A1(x) ? A2(x)) o Rg (1.0, 0.9,
0.7, 1.0, 0.7, 0.4, 0.0)
40Mamdani-local , A? A1(x)
x1, x2, x3, x4, x5, x6, x7
A? A1(x) (1.0, 0.6, 0.4, 0.2, 0.0, 0.0, 0.0)
y1, y2, y3, y4, y5, y6, y7
B1(y) (1.0, 0.9, 0.7, 0.5, 0.3, 0.0, 0.0)
B2 (y) (0.0, 0.5, 0.7, 0.4, 0.4, 0.4, 0.0)
B3 (y) (0.0, 0.0, 0.2, 0.2, 0.2, 0.2, 0.2)
B(y) ? i Bi(y) (1.0, 0.9, 0.7, 0.5, 0.4,
0.4, 0.2)
Compare to A o Rm (1.0, 0.9, 0.7, 0.5, 0.4,
0.4, 0.2)
41Gödel-local , A? A1(x)
x1, x2, x3, x4, x5, x6, x7
A? A1(x) (1.0, 0.6, 0.4, 0.2, 0.0, 0.0, 0.0)
y1, y2, y3, y4, y5, y6, y7
B1(y) (1.0, 0.9, 0.7, 0.5, 0.3, 0.0, 0.0)
B2 (y) (1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
B3 (y) (1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
B(y) ? i Bi(y) (1.0, 0.9, 0.7, 0.5, 0.3,
0.0, 0.0)
Compare to A o Rg (1.0, 0.9, 0.7, 0.5, 0.3,
0.0, 0.0)
42Mamdani-local , A? A1(x)
x1, x2, x3, x4, x5, x6, x7
A? A1(x) (1.0, 1.0, 0.8, 0.6, 0.4, 0.2, 0.0)
y1, y2, y3, y4, y5, y6, y7
B1(y) (1.0, 0.9, 0.7, 0.5, 0.3, 0.0, 0.0)
B2 (y) (0.0, 0.5, 0.7, 0.8, 0.7, 0.5, 0.0)
B3 (y) (0.0, 0.0, 0.3, 0.4, 0.4, 0.4, 0.4)
B(y) ? i Bi(y) (1.0, 0.9, 0.7, 0.8, 0.7,
0.5, 0.4)
Compare to A o Rm (1.0, 0.9, 0.7, 0.8, 0.7,
0.5, 0.4)
43Gödel-local , A? A1(x)
x1, x2, x3, x4, x5, x6, x7
A? A1(x) (1.0, 1.0, 0.8, 0.6, 0.4, 0.2, 0.0)
y1, y2, y3, y4, y5, y6, y7
B1(y) (1.0, 1.0, 0.8, 0.6, 0.4, 0.2, 0.0)
B2 (y) (1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
B3 (y) (1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
B(y) ? i Bi(y) (1.0, 1.0, 0.8, 0.6, 0.4,
0.2, 0.0)
Compare to A o Rg (1.0, 1.0, 0.7, 0.6, 0.4,
0.2, 0.0)
44Inference with crisp input
- In this case
- where mA(x0) 1and mA(x0) 0 if x ? x0
- For example
45Global inference
- Ri if Ai(x) then Bi(y), given A(x)
- Mamdani
- Gödel
- B (y) A(x) o Rm or B (y) A(x) o Rg
46Local inference
- Ri if Ai(x) then Bi(y), given A(x)
- Mamdani
- Gödel
47A is crisp, global
- A (0.0, 0.0, 1.0, 0.0, 0.0, 0, 0)
- Mamdani global B A o Rm (0.6, 0.6, 0.7,
0.8, 0.7, 0.5, 0.2) - Gödel global B A o Rg (0.0, 0.0, 0.7, 0.5,
0.3, 0.0, 0.0)
48A local, Mamdani
x1, x2, x3, x4, x5, x6, x7
A (0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0)
y1, y2, y3, y4, y5, y6, y7
B1(y) (0.6, 0.6, 0.6, 0.5, 0.3, 0.0, 0.0)
B2 (y) (0.0, 0.5, 0.7, 0.8, 0.7, 0.5, 0.0)
B3 (y) (0.0, 0.0, 0.2, 0.2, 0.2, 0.2, 0.2)
B(y) ? i Bi(y) (0.6, 0.6, 0.7, 0.8, 0.7,
0.5, 0.2)
Compare to A o Rm (0.6, 0.6, 0.7, 0.8, 0.7,
0.5, 0.2)
49A local, Gödel
x1, x2, x3, x4, x5, x6, x7
A (0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0)
y1, y2, y3, y4, y5, y6, y7
B1(y) (1.0, 1.0, 1.0, 0.5, 0.3, 0.0, 0.0)
B2 (y) (0.0, 0.5, 0.7, 1.0, 0.7, 0.5, 0.0)
B3 (y) (0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0)
B(y) ?i Bi(y) (0.0, 0.0, 0.7, 0.5, 0.3,
0.0, 0.0)
Compare to A o Rg (0.0, 0.0, 0.7, 0.5, 0.3,
0.0, 0.0)
50Conclusion
- In the case of fuzzy inputs
- Gödel gives different results for global and
local inference - Mamdani gives similar results for global and
local inference - In the case of crisp inputs
- Mamdani and Gödel give similar results for global
and local inference