Top Banner
Fuzzy Logic E. Fuzzy Inference Engine
22

Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

May 21, 2018

Download

Documents

phamthuy
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

Fuzzy Logic

E. Fuzzy Inference Engine

Page 2: Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

“antecedent”

“consequent”

Page 3: Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

Assume that we need to evaluate student applicants based on their GPA and Assume that we need to evaluate student applicants based on their GPA and Assume that we need to evaluate student applicants based on their GPA and Assume that we need to evaluate student applicants based on their GPA and

GRE scores.GRE scores.GRE scores.GRE scores.

For simplicity, let us have three categories for each score [High (H), Medium For simplicity, let us have three categories for each score [High (H), Medium For simplicity, let us have three categories for each score [High (H), Medium For simplicity, let us have three categories for each score [High (H), Medium

(M), and Low(L)](M), and Low(L)](M), and Low(L)](M), and Low(L)](M), and Low(L)](M), and Low(L)](M), and Low(L)](M), and Low(L)]

Let us assume that the decision should be Excellent (E), Very Good (VG), Good Let us assume that the decision should be Excellent (E), Very Good (VG), Good Let us assume that the decision should be Excellent (E), Very Good (VG), Good Let us assume that the decision should be Excellent (E), Very Good (VG), Good

(G), Fair (F) or Poor (P)(G), Fair (F) or Poor (P)(G), Fair (F) or Poor (P)(G), Fair (F) or Poor (P)

An expert will associate the decisions to the GPA and GRE score. They are then An expert will associate the decisions to the GPA and GRE score. They are then An expert will associate the decisions to the GPA and GRE score. They are then An expert will associate the decisions to the GPA and GRE score. They are then

Tabulated.Tabulated.Tabulated.Tabulated.

Page 4: Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

Fuzzy if-then RulesIfIfIfIf the GRE is the GRE is the GRE is the GRE is HIGHHIGHHIGHHIGH andandandand the GPA is the GPA is the GPA is the GPA is HIGHHIGHHIGHHIGH thenthenthenthen the student will be the student will be the student will be the student will be

EXCELLENTEXCELLENTEXCELLENTEXCELLENT....

IfIfIfIf the GRE is the GRE is the GRE is the GRE is LOWLOWLOWLOW andandandand the GPA is the GPA is the GPA is the GPA is HIGHHIGHHIGHHIGH thenthenthenthen the student will be the student will be the student will be the student will be

Fuzzy Linguistic VariablesFuzzy Linguistic VariablesFuzzy Linguistic VariablesFuzzy Linguistic Variables Fuzzy Logic

Antecedent Consequent

IfIfIfIf the GRE is the GRE is the GRE is the GRE is LOWLOWLOWLOW andandandand the GPA is the GPA is the GPA is the GPA is HIGHHIGHHIGHHIGH thenthenthenthen the student will be the student will be the student will be the student will be

FAIRFAIRFAIRFAIR....

etcetcetcetc

Page 5: Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

Antecedents

Consequents

Page 6: Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

Fuzzifier converts a crisp input into a vector of fuzzy membership Fuzzifier converts a crisp input into a vector of fuzzy membership Fuzzifier converts a crisp input into a vector of fuzzy membership Fuzzifier converts a crisp input into a vector of fuzzy membership

values. values. values. values.

The membership functions The membership functions The membership functions The membership functions

� reflects the designer's knowledge

� provides smooth transition between fuzzy sets

� are simple to calculate

Typical shapes of the membership function are Gaussian, trapezoidal Typical shapes of the membership function are Gaussian, trapezoidal Typical shapes of the membership function are Gaussian, trapezoidal Typical shapes of the membership function are Gaussian, trapezoidal

and triangular.and triangular.and triangular.and triangular.

Page 7: Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

µGRE

µGRE = {µL , µM , µH }

Page 8: Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

µGPA

µGPA = {µL , µM , µH }

Page 9: Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

µc

Page 10: Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

Transform the crisp antecedents into a vector of fuzzy Transform the crisp antecedents into a vector of fuzzy Transform the crisp antecedents into a vector of fuzzy Transform the crisp antecedents into a vector of fuzzy

membership values.membership values.membership values.membership values.

Assume a student with GRE=900 and GPA=3.6. Examining Assume a student with GRE=900 and GPA=3.6. Examining Assume a student with GRE=900 and GPA=3.6. Examining Assume a student with GRE=900 and GPA=3.6. Examining Assume a student with GRE=900 and GPA=3.6. Examining Assume a student with GRE=900 and GPA=3.6. Examining Assume a student with GRE=900 and GPA=3.6. Examining Assume a student with GRE=900 and GPA=3.6. Examining

the membership function givesthe membership function givesthe membership function givesthe membership function gives

µGRE = {µL = 0.8 , µM = 0.2 , µH = 0}

µGPA = {µL = 0 , µM = 0.6 , µH = 0.4}

Page 11: Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

µGRE

0.8

900

0.2

0.8

Page 12: Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

0.6

3.6

0.40.6

Page 13: Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

0.8 0.2 0.0

0.0

0.6

0.4

Page 14: Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

0.8 0.2 0.0

0.0

0.6

0.4

0.0 0.0 0.0

0.6 0.2 0.0

0.4 0.2 0.0

Page 15: Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

0.8 0.2 0.0

0.0

The student is

GOOD if

(the GRE is HIGH

and the GPA is

MEDIUM)0.0

0.6

0.4

0.0 0.0 0.0

0.6 0.2 0.0

0.4 0.2 0.0

MEDIUM)

OR

(the GRE is

MEDIUM and the

GPA is MEDIUM)The consequent GOOD has a membership of max(0.6,0.2)=0.6

Page 16: Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

0.8 0.2 0.0

0.0

µµµµE = 0.0

µµµµVG = 0.0

µµµµF = max( 0.0, 0.4)0.0

0.6

0.4

0.0 0.0 0.0

0.6 0.2 0.0

0.4 0.2 0.0

µµµµF = max( 0.0, 0.4)

= 0.4

µµµµG = max( 0.6, 0.2)

= 0.6

µµµµB = max( 0,0,0.2)

= 0.2

Page 17: Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

0.6

µc

0.4

0.2

Page 18: Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

Converts the output fuzzy numbers into a unique (crisp) number

Center of Mass MethodCenter of Mass MethodCenter of Mass MethodCenter of Mass Method: Add all weightedweightedweightedweighted curves and find the center of mass

µ0.6

0.4

0.2

µc

Page 19: Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

µc

Center of Mass MethodCenter of Mass MethodCenter of Mass MethodCenter of Mass Method: Add all clippedclippedclippedclipped curves and find the center of mass

0.60.40.2

Page 20: Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

AnAnAnAn Alternate Approach: Fuzzy set with the largest membership value Alternate Approach: Fuzzy set with the largest membership value Alternate Approach: Fuzzy set with the largest membership value Alternate Approach: Fuzzy set with the largest membership value

is selected.is selected.is selected.is selected.

Fuzzy decision: Fuzzy decision: Fuzzy decision: Fuzzy decision:

{B, F, G,VG, E} = {0.2, 0.4, 0.6, 0.0, 0.0}{B, F, G,VG, E} = {0.2, 0.4, 0.6, 0.0, 0.0}{B, F, G,VG, E} = {0.2, 0.4, 0.6, 0.0, 0.0}{B, F, G,VG, E} = {0.2, 0.4, 0.6, 0.0, 0.0}{B, F, G,VG, E} = {0.2, 0.4, 0.6, 0.0, 0.0}{B, F, G,VG, E} = {0.2, 0.4, 0.6, 0.0, 0.0}{B, F, G,VG, E} = {0.2, 0.4, 0.6, 0.0, 0.0}{B, F, G,VG, E} = {0.2, 0.4, 0.6, 0.0, 0.0}

Final Decision (FD) = Good StudentFinal Decision (FD) = Good StudentFinal Decision (FD) = Good StudentFinal Decision (FD) = Good Student

If two decisions have same membership max, use the average of the If two decisions have same membership max, use the average of the If two decisions have same membership max, use the average of the If two decisions have same membership max, use the average of the

two.two.two.two.

Page 21: Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

CELN MN SN ZE SP MP LP

LN LN LN LN LN MN SN SNMN LN LN LN MN SN ZE ZEMN LN LN LN MN SN ZE ZESN LN LN MN SN ZE ZE SP

E ZE LN MN SN ZE SP MP LPSP SN ZE ZE SP MP LP LPMP ZE ZE SP MP LP LP LPLP SP SP MP LP LP LP LP

Page 22: Materi Fuzzy Logic -Fuzzy Inference - Direktori File UPIfile.upi.edu/Direktori/FPMIPA/JUR._PEND._FISIKA/196302071991031... · Fuzzifier converts a crisp input into a vector of fuzzy

0

1

m

ECU

ZE SP MP LPSNMNLN

-3 -2 -1 0 1 2 3

LN MN SN ZE SP MP LP

0

1

m

CE

0 1 3 6-1-3-60