Department of Information Technology 1Soft Computing (ITC4256 )
Dr. C.V. Suresh Babu
Professor
Department of IT
Hindustan Institute of Science & Technology
Fuzzy Logic: Member Functions
Department of Information Technology 2Soft Computing (ITC4256 )
Action Plan
• Fuzzy Logic
• Fuzzy Controller
• Fuzzification
• Bivalent and Multivalent Logics
• Linguistic Variables
• Fuzzy Sets
• Membership Functions
– Triangular function:
– Trapezoidal function:
– Gaussian function:
• Crisp Set Operators
• Fuzzy Set Operators
• Hedges
• Fuzzy Inference
• Fuzzy Rules
• Fuzzy Expert Systems
• Neuro-Fuzzy Systems
• Quiz at the end of session
Department of Information Technology 3Soft Computing (ITC4256 )
Fuzzy Logic
• Fuzzy logic:
– A way to represent variation or imprecision in
logic
– A way to make use of natural language in logic
– Approximate reasoning
• Humans say things like "If it is little cold and I
will drive drink"
• Linguistic variables:
– Temp: {freezing, cool, warm, hot}
– Cloud Cover: {overcast, partly cloudy, sunny}
– Speed: {slow, fast}
Department of Information Technology 4Soft Computing (ITC4256 )
Fuzzy Controller
Department of Information Technology 5Soft Computing (ITC4256 )
Department of Information Technology 6Soft Computing (ITC4256 )
Fuzzification
• Fuzzification is the process of converting a crisp input value to a fuzzy value that is performed by the use
of the information in the knowledge base. Although various types of curves can be seen in literature,
Gaussian, triangular, and trapezoidal MFs are the most commonly used in the fuzzification process
Department of Information Technology 7Soft Computing (ITC4256 )
Bivalent and Multivalent Logics
• Bivalent (Aristotelian) logic uses two logical values – true and false.
• Multivalent logics use many logical values – often in a range of real
numbers from 0 to 1.
• Important to note the difference between multivalent logic and
probability – P(A) = 0.5 means that A may be true or may be false – a
logical value of 0.5 means both true and false at the same time.
Department of Information Technology 8Soft Computing (ITC4256 )
Linguistic Variables
• Variables used in fuzzy systems to express qualities such as
height, which can take values such as “tall”, “short” or “very
tall”.
• These values define subsets of the universe of discourse.
Department of Information Technology 9Soft Computing (ITC4256 )
Fuzzy Sets
• A crisp set is a set for which each value either is or is not contained in the
set.
• For a fuzzy set, every value has a membership value, and so is a member to
some extent.
• The membership value defines the extent to which a variable is a member of
a fuzzy set.
• The membership value is from 0 (not at all a member of the set) to 1.
Department of Information Technology 10Soft Computing (ITC4256 )
Membership Functions: Definition
• A membership function for a fuzzy set A on the universe of discourse X is defined as µA:X → [0,1], where
each element of X is mapped to a value between 0 and 1. This value, called membership value or degree
of membership, quantifies the grade of membership of the element in X to the fuzzy set A.
• Membership functions allow us to graphically represent a fuzzy set. The x axis represents the universe of
discourse, whereas the y axis represents the degrees of membership in the [0,1] interval.
• Simple functions are used to build membership functions. Because we are defining fuzzy concepts, using
more complex functions does not add more precision.
Department of Information Technology 11Soft Computing (ITC4256 )
Membership Functions
• The following function defines the extent
to which a value x is a member of fuzzy set
B:
• This function would be stored in the
computer as:
B = {(0, 1), (2, 0)}
• This function could represent, for example,
the extent to which a person can be
considered a baby, based on their age.
Department of Information Technology 12Soft Computing (ITC4256 )
Triangular function:
defined by a lower limit a, an upper limit b, and a value m, where a < m < b.
Department of Information Technology 13Soft Computing (ITC4256 )
Trapezoidal function:
defined by a lower limit a, an upper limit d, a lower support limit b, and an upper support limit c, where
a < b < c < d.
Department of Information Technology 14Soft Computing (ITC4256 )
Trapezoidal function:
There are two special cases of a trapezoidal function, which are called R-functions and L-functions:
R-functions: with parameters a = b = - ∞
Department of Information Technology 15Soft Computing (ITC4256 )
Trapezoidal function:
L-Functions: with parameters c = d = + ∞
Department of Information Technology 16Soft Computing (ITC4256 )
Gaussian function:
defined by a central value m and a standard deviation k > 0. The smaller k is, the narrower the “bell” is.
NOTE: The function used in the previous link to draw gaussian
functions uses a different k' parameter. The mapping between
both parameters is: k' = 1 / 2k2
Department of Information Technology 17Soft Computing (ITC4256 )
Crisp Set Operators
Not A – the complement of A, which contains the elements which
are not contained in A.
A  B – the intersection of A and B, which contains those elements
which are contained in both A and B.
A  B – the union of A and B which contains all the elements of A
and all the elements of B.
Fuzzy sets use the same operators, but the operators have different
meanings.
Department of Information Technology 18Soft Computing (ITC4256 )
Fuzzy Set Operators
• Fuzzy set operators can be defined by their membership
functions
– M¬A(x) = 1 - MA(x)
– MA  B (x) = MIN (MA (x), MB (x))
– MA  B (x) = MAX (MA (x), MB (x))
• We can also define containment (subset operator):
– B  A iff x (MB (x)  MA (x))
Department of Information Technology 19Soft Computing (ITC4256 )
Hedges
• A hedge is a qualifier such as “very”, “quite”, “somewhat” or
“extremely”.
• When a hedge is applied to a fuzzy set it creates a new fuzzy set.
• Mathematic functions are usually used to define the effect of a hedge.
• For example, “Very” might be defined as:
– MVA (x) = (MA (x))2
Department of Information Technology 20Soft Computing (ITC4256 )
Fuzzy Logic (1)
• A nonmonotonic logical system that applies to fuzzy variables.
• We use connectives defined as:
– A V B  MAX (A, B)
– A Λ B  MIN (A, B)
– ¬A  1 – A
• We can also define truth tables:
Department of Information Technology 21Soft Computing (ITC4256 )
Fuzzy Inference (1)
• Inference is harder to manage.
• Since:
A  B  ¬A V B
• Hence, we might define fuzzy inference as:
A  B  MAX ((1 – A), B)
• This gives the unintuitive truth table shown on
the right.
• This gives us 0.5  0 = 0.5, where we would
expect
0.5  0 = 0
Department of Information Technology 22Soft Computing (ITC4256 )
Fuzzy Inference (2)
• An alternative is Gödel implication, which is
defined as:
A  B  (A ≤ B) V B
• This gives a more intuitive truth table.
Department of Information Technology 23Soft Computing (ITC4256 )
Fuzzy Inference (3)
• Mamdani inference derives a single crisp value by applying fuzzy rules to
a set of crisp input values.
Step 1: Fuzzify the inputs.
Step 2: Apply the inputs to the antecedents of the fuzzy rules to obtain a
set of fuzzy outputs.
Step 3: Convert the fuzzy outputs to a single crisp value using
defuzzification.
Department of Information Technology 24Soft Computing (ITC4256 )
Fuzzy Rules
• A fuzzy rule takes the following form:
IF A op x then B = y
• op is an operator such as >, < or =.
• For example:
IF temperature > 50 then fan speed = fast
IF height = tall then trouser length = long
IF study time = short then grades = poor
Department of Information Technology 25Soft Computing (ITC4256 )
Fuzzy Expert Systems
• A fuzzy expert system is built by creating a set of fuzzy rules, and applying
fuzzy inference.
• In many ways this is more appropriate than standard expert systems since
expert knowledge is not usually black and white but has elements of grey.
• The first stage in building a fuzzy expert system is choosing suitable
linguistic variables.
• Rules are then generated based on the expert’s knowledge, using the
linguistic variables.
Department of Information Technology 26Soft Computing (ITC4256 )
Neuro-Fuzzy Systems
• A fuzzy neural network is usually a feed-forward network with
five layers:
1. Input layer – receives crisp inputs
2. Fuzzy input membership functions
3. Fuzzy rules
4. Fuzzy output
membership functions
5. Output layer – outputs
crisp values
Department of Information Technology 27Soft Computing (ITC4256 )
Test Yourself
1. Fuzzy logic is :
a) Used to respond to questions in a humanlike way
b) A new programming language used to program animation
c) The result of fuzzy thinking
d) A term that indicates logical values greater than one
2. What is the form of Fuzzy logic?
a) Two-valued logic
b) Crisp set logic
c) Many-valued logic
d) Binary set logic
3. The room temperature is hot. Here the hot (use of linguistic variable is used) can be represented by _______
a) Fuzzy Set
b) Crisp Set
c) Fuzzy & Crisp Set
d) None of the mentioned
4. The values of the set membership is represented by ___________
a) Discrete Set
b) Degree of truth
c) Probabilities
d) Both Degree of truth & Probabilities
5. The truth values of traditional set theory is ____________ and that of fuzzy set is __________
a) Either 0 or 1, between 0 & 1
b) Between 0 & 1, either 0 or 1
c) Between 0 & 1, between 0 & 1
d) Either 0 or 1, either 0 or 1
Department of Information Technology 28Soft Computing (ITC4256 )
Answers
1. Fuzzy logic is :
a) Used to respond to questions in a humanlike way
b) A new programming language used to program animation
c) The result of fuzzy thinking
d) A term that indicates logical values greater than one
2. What is the form of Fuzzy logic?
a) Two-valued logic
b) Crisp set logic
c) Many-valued logic
d) Binary set logic
3. The room temperature is hot. Here the hot (use of linguistic variable is used) can be represented by _______
a) Fuzzy Set
b) Crisp Set
c) Fuzzy & Crisp Set
d) None of the mentioned
4. The values of the set membership is represented by ___________
a) Discrete Set
b) Degree of truth
c) Probabilities
d) Both Degree of truth & Probabilities
5. The truth values of traditional set theory is ____________ and that of fuzzy set is __________
a) Either 0 or 1, between 0 & 1
b) Between 0 & 1, either 0 or 1
c) Between 0 & 1, between 0 & 1
d) Either 0 or 1, either 0 or 1

Fuzzy logic member functions

  • 1.
    Department of InformationTechnology 1Soft Computing (ITC4256 ) Dr. C.V. Suresh Babu Professor Department of IT Hindustan Institute of Science & Technology Fuzzy Logic: Member Functions
  • 2.
    Department of InformationTechnology 2Soft Computing (ITC4256 ) Action Plan • Fuzzy Logic • Fuzzy Controller • Fuzzification • Bivalent and Multivalent Logics • Linguistic Variables • Fuzzy Sets • Membership Functions – Triangular function: – Trapezoidal function: – Gaussian function: • Crisp Set Operators • Fuzzy Set Operators • Hedges • Fuzzy Inference • Fuzzy Rules • Fuzzy Expert Systems • Neuro-Fuzzy Systems • Quiz at the end of session
  • 3.
    Department of InformationTechnology 3Soft Computing (ITC4256 ) Fuzzy Logic • Fuzzy logic: – A way to represent variation or imprecision in logic – A way to make use of natural language in logic – Approximate reasoning • Humans say things like "If it is little cold and I will drive drink" • Linguistic variables: – Temp: {freezing, cool, warm, hot} – Cloud Cover: {overcast, partly cloudy, sunny} – Speed: {slow, fast}
  • 4.
    Department of InformationTechnology 4Soft Computing (ITC4256 ) Fuzzy Controller
  • 5.
    Department of InformationTechnology 5Soft Computing (ITC4256 )
  • 6.
    Department of InformationTechnology 6Soft Computing (ITC4256 ) Fuzzification • Fuzzification is the process of converting a crisp input value to a fuzzy value that is performed by the use of the information in the knowledge base. Although various types of curves can be seen in literature, Gaussian, triangular, and trapezoidal MFs are the most commonly used in the fuzzification process
  • 7.
    Department of InformationTechnology 7Soft Computing (ITC4256 ) Bivalent and Multivalent Logics • Bivalent (Aristotelian) logic uses two logical values – true and false. • Multivalent logics use many logical values – often in a range of real numbers from 0 to 1. • Important to note the difference between multivalent logic and probability – P(A) = 0.5 means that A may be true or may be false – a logical value of 0.5 means both true and false at the same time.
  • 8.
    Department of InformationTechnology 8Soft Computing (ITC4256 ) Linguistic Variables • Variables used in fuzzy systems to express qualities such as height, which can take values such as “tall”, “short” or “very tall”. • These values define subsets of the universe of discourse.
  • 9.
    Department of InformationTechnology 9Soft Computing (ITC4256 ) Fuzzy Sets • A crisp set is a set for which each value either is or is not contained in the set. • For a fuzzy set, every value has a membership value, and so is a member to some extent. • The membership value defines the extent to which a variable is a member of a fuzzy set. • The membership value is from 0 (not at all a member of the set) to 1.
  • 10.
    Department of InformationTechnology 10Soft Computing (ITC4256 ) Membership Functions: Definition • A membership function for a fuzzy set A on the universe of discourse X is defined as µA:X → [0,1], where each element of X is mapped to a value between 0 and 1. This value, called membership value or degree of membership, quantifies the grade of membership of the element in X to the fuzzy set A. • Membership functions allow us to graphically represent a fuzzy set. The x axis represents the universe of discourse, whereas the y axis represents the degrees of membership in the [0,1] interval. • Simple functions are used to build membership functions. Because we are defining fuzzy concepts, using more complex functions does not add more precision.
  • 11.
    Department of InformationTechnology 11Soft Computing (ITC4256 ) Membership Functions • The following function defines the extent to which a value x is a member of fuzzy set B: • This function would be stored in the computer as: B = {(0, 1), (2, 0)} • This function could represent, for example, the extent to which a person can be considered a baby, based on their age.
  • 12.
    Department of InformationTechnology 12Soft Computing (ITC4256 ) Triangular function: defined by a lower limit a, an upper limit b, and a value m, where a < m < b.
  • 13.
    Department of InformationTechnology 13Soft Computing (ITC4256 ) Trapezoidal function: defined by a lower limit a, an upper limit d, a lower support limit b, and an upper support limit c, where a < b < c < d.
  • 14.
    Department of InformationTechnology 14Soft Computing (ITC4256 ) Trapezoidal function: There are two special cases of a trapezoidal function, which are called R-functions and L-functions: R-functions: with parameters a = b = - ∞
  • 15.
    Department of InformationTechnology 15Soft Computing (ITC4256 ) Trapezoidal function: L-Functions: with parameters c = d = + ∞
  • 16.
    Department of InformationTechnology 16Soft Computing (ITC4256 ) Gaussian function: defined by a central value m and a standard deviation k > 0. The smaller k is, the narrower the “bell” is. NOTE: The function used in the previous link to draw gaussian functions uses a different k' parameter. The mapping between both parameters is: k' = 1 / 2k2
  • 17.
    Department of InformationTechnology 17Soft Computing (ITC4256 ) Crisp Set Operators Not A – the complement of A, which contains the elements which are not contained in A. A  B – the intersection of A and B, which contains those elements which are contained in both A and B. A  B – the union of A and B which contains all the elements of A and all the elements of B. Fuzzy sets use the same operators, but the operators have different meanings.
  • 18.
    Department of InformationTechnology 18Soft Computing (ITC4256 ) Fuzzy Set Operators • Fuzzy set operators can be defined by their membership functions – M¬A(x) = 1 - MA(x) – MA  B (x) = MIN (MA (x), MB (x)) – MA  B (x) = MAX (MA (x), MB (x)) • We can also define containment (subset operator): – B  A iff x (MB (x)  MA (x))
  • 19.
    Department of InformationTechnology 19Soft Computing (ITC4256 ) Hedges • A hedge is a qualifier such as “very”, “quite”, “somewhat” or “extremely”. • When a hedge is applied to a fuzzy set it creates a new fuzzy set. • Mathematic functions are usually used to define the effect of a hedge. • For example, “Very” might be defined as: – MVA (x) = (MA (x))2
  • 20.
    Department of InformationTechnology 20Soft Computing (ITC4256 ) Fuzzy Logic (1) • A nonmonotonic logical system that applies to fuzzy variables. • We use connectives defined as: – A V B  MAX (A, B) – A Λ B  MIN (A, B) – ¬A  1 – A • We can also define truth tables:
  • 21.
    Department of InformationTechnology 21Soft Computing (ITC4256 ) Fuzzy Inference (1) • Inference is harder to manage. • Since: A  B  ¬A V B • Hence, we might define fuzzy inference as: A  B  MAX ((1 – A), B) • This gives the unintuitive truth table shown on the right. • This gives us 0.5  0 = 0.5, where we would expect 0.5  0 = 0
  • 22.
    Department of InformationTechnology 22Soft Computing (ITC4256 ) Fuzzy Inference (2) • An alternative is Gödel implication, which is defined as: A  B  (A ≤ B) V B • This gives a more intuitive truth table.
  • 23.
    Department of InformationTechnology 23Soft Computing (ITC4256 ) Fuzzy Inference (3) • Mamdani inference derives a single crisp value by applying fuzzy rules to a set of crisp input values. Step 1: Fuzzify the inputs. Step 2: Apply the inputs to the antecedents of the fuzzy rules to obtain a set of fuzzy outputs. Step 3: Convert the fuzzy outputs to a single crisp value using defuzzification.
  • 24.
    Department of InformationTechnology 24Soft Computing (ITC4256 ) Fuzzy Rules • A fuzzy rule takes the following form: IF A op x then B = y • op is an operator such as >, < or =. • For example: IF temperature > 50 then fan speed = fast IF height = tall then trouser length = long IF study time = short then grades = poor
  • 25.
    Department of InformationTechnology 25Soft Computing (ITC4256 ) Fuzzy Expert Systems • A fuzzy expert system is built by creating a set of fuzzy rules, and applying fuzzy inference. • In many ways this is more appropriate than standard expert systems since expert knowledge is not usually black and white but has elements of grey. • The first stage in building a fuzzy expert system is choosing suitable linguistic variables. • Rules are then generated based on the expert’s knowledge, using the linguistic variables.
  • 26.
    Department of InformationTechnology 26Soft Computing (ITC4256 ) Neuro-Fuzzy Systems • A fuzzy neural network is usually a feed-forward network with five layers: 1. Input layer – receives crisp inputs 2. Fuzzy input membership functions 3. Fuzzy rules 4. Fuzzy output membership functions 5. Output layer – outputs crisp values
  • 27.
    Department of InformationTechnology 27Soft Computing (ITC4256 ) Test Yourself 1. Fuzzy logic is : a) Used to respond to questions in a humanlike way b) A new programming language used to program animation c) The result of fuzzy thinking d) A term that indicates logical values greater than one 2. What is the form of Fuzzy logic? a) Two-valued logic b) Crisp set logic c) Many-valued logic d) Binary set logic 3. The room temperature is hot. Here the hot (use of linguistic variable is used) can be represented by _______ a) Fuzzy Set b) Crisp Set c) Fuzzy & Crisp Set d) None of the mentioned 4. The values of the set membership is represented by ___________ a) Discrete Set b) Degree of truth c) Probabilities d) Both Degree of truth & Probabilities 5. The truth values of traditional set theory is ____________ and that of fuzzy set is __________ a) Either 0 or 1, between 0 & 1 b) Between 0 & 1, either 0 or 1 c) Between 0 & 1, between 0 & 1 d) Either 0 or 1, either 0 or 1
  • 28.
    Department of InformationTechnology 28Soft Computing (ITC4256 ) Answers 1. Fuzzy logic is : a) Used to respond to questions in a humanlike way b) A new programming language used to program animation c) The result of fuzzy thinking d) A term that indicates logical values greater than one 2. What is the form of Fuzzy logic? a) Two-valued logic b) Crisp set logic c) Many-valued logic d) Binary set logic 3. The room temperature is hot. Here the hot (use of linguistic variable is used) can be represented by _______ a) Fuzzy Set b) Crisp Set c) Fuzzy & Crisp Set d) None of the mentioned 4. The values of the set membership is represented by ___________ a) Discrete Set b) Degree of truth c) Probabilities d) Both Degree of truth & Probabilities 5. The truth values of traditional set theory is ____________ and that of fuzzy set is __________ a) Either 0 or 1, between 0 & 1 b) Between 0 & 1, either 0 or 1 c) Between 0 & 1, between 0 & 1 d) Either 0 or 1, either 0 or 1