270 likes | 565 Views
Fuzzy Logic. E. Fuzzy Inference Engine. Crisp input. Fuzzification. Rules. Defuzzification. Crisp Output Result. Fuzzy Inference. “antecedent”. “consequent”. Fuzzy Inference Example. Assume that we need to evaluate student applicants based on their GPA and GRE scores.
E N D
Fuzzy Logic E. Fuzzy Inference Engine
Crisp input Fuzzification Rules Defuzzification Crisp Output Result Fuzzy Inference “antecedent” “consequent”
Fuzzy Inference Example • Assume that we need to evaluate student applicants based on their GPA and GRE scores. • For simplicity, let us have three categories for each score [High (H), Medium (M), and Low(L)] • Let us assume that the decision should be Excellent (E), Very Good (VG), Good (G), Fair (F) or Poor (P) • An expert will associate the decisions to the GPA and GRE score. They are then Tabulated.
Fuzzy Inference Example • Fuzzy if-then Rules If the GRE is HIGHand the GPA is HIGHthen the student will be EXCELLENT. If the GRE is LOWand the GPA is HIGHthen the student will be FAIR. etc Fuzzy Linguistic Variables Fuzzy Logic Antecedent Consequent
GRE Antecedents L H M E VG F H G G B GPA M B B F L Fuzzy Rule Table Consequents
Fuzzification • Fuzzifier converts a crisp input into a vector of fuzzy membership values. • 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 and triangular.
mGRE Medium Low High 1 800 1200 1800 GRE mGRE = {mL , mM , mH } Membership Functions for GRE
Medium Low High 1 2.2 3.0 3.8 GPA Membership Functions for the GPA mGPA mGPA = {mL , mM , mH }
c E B VG G F 1 60 90 80 70 100 Decision Membership Function for the Consequent
mGRE = {mL = 0.8 , mM = 0.2, mH = 0} mGPA = {mL = 0 , mM = 0.6, mH = 0.4} Fuzzification • Transform the crisp antecedents into a vector of fuzzy membership values. • Assume a student with GRE=900 and GPA=3.6. Examining the membership function gives
mGRE Medium Low High 1 800 1200 1800 GRE Fuzzification 0.8 0.2 900
Medium Low High 1 2.2 3.0 3.8 GPA Fuzzification 0.6 0.4 3.6
Table: GRE 0.8 0.2 0.0 L H M E VG F H 0.0 0.6 0.4 G GPA G B M B B L F
Table: GRE 0.8 0.2 0.0 L H M E VG F 0.0 0.6 0.4 H 0.0 0.0 0.0 GPA G G B M 0.6 0.2 0.0 F B B L 0.4 0.2 0.0
GRE 0.8 0.2 0.0 L H M GPA E VG F 0.0 0.6 0.4 H 0.0 0.0 0.0 G G B M 0.6 0.2 0.0 F B B L 0.4 0.2 0.0 Rule Evaluation The student is GOOD if (the GRE is HIGH and the GPA is 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
GRE 0.8 0.2 0.0 L H M GPA E VG F 0.0 0.6 0.4 H 0.0 0.0 0.0 G G B M 0.6 0.2 0.0 F B B L 0.4 0.2 0.0 Rule Evaluation E = 0.0 VG = 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
c 1 G 0.6 0.4 0.2 F B E VG 60 70 80 90 100 Decision Weight Consequent Memberships
c 1 G 0.6 0.4 0.2 F B E VG 60 70 80 90 100 Defuzzification • Converts the output fuzzy numbers into a unique (crisp) number • Center of Mass Method: Add all weighted curves and find the center of mass
c E B VG G F 1 60 90 80 70 100 Decision Defuzzification • Center of Mass Method: Add all clipped curves and find the center of mass 0.6 0.4 0.2
Center of maxima and Mean of Maxima • AnAlternate Approach: Fuzzy set with the largest membership value is selected. • Fuzzy decision: {B, F, G,VG, E} = {0.2, 0.4, 0.6, 0.0, 0.0} • Final Decision (FD) = Good Student • If two decisions have same membership max, use the average of the two.
CE LN MN SN ZE SP MP LP LN LN LN LN LN MN SN SN MN LN LN LN MN SN ZE ZE SN LN LN MN SN ZE ZE SP E ZE LN MN SN ZE SP MP LP SP SN ZE ZE SP MP LP LP MP ZE ZE SP MP LP LP LP LP SP SP MP LP LP LP LP Example: Fuzzy Table for Control
m LN MN SN ZE SP MP LP 1 E CU 0 -6 -3 -1 0 1 3 6 m LN MN SN ZE SP MP LP 1 CE 0 -3 -2 -1 0 1 2 3 Membership Functions