Materi Fuzzy Logic -Fuzzy Inference - Direktori File...

Post on 21-May-2018

232 views 3 download

Transcript of Materi Fuzzy Logic -Fuzzy Inference - Direktori File...

Fuzzy Logic

E. Fuzzy Inference Engine

“antecedent”

“consequent”

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.

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

Antecedents

Consequents

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.

µGRE

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

µGPA

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

µc

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}

µGRE

0.8

900

0.2

0.8

0.6

3.6

0.40.6

0.8 0.2 0.0

0.0

0.6

0.4

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

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

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

0.6

µc

0.4

0.2

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

µ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

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.

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

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