DOC PREVIEW
USC CSCI 561 - session20-21

This preview shows page 1-2-17-18-19-36-37 out of 37 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

This time: Fuzzy Logic and Fuzzy InferenceWhat is fuzzy logic?Why use fuzzy logic?Tipping exampleTipping example: The non-fuzzy approachSlide 6Tipping example: ExtendedSlide 8Slide 9Slide 10Slide 11Tipping problem: the fuzzy approachTipping problem: fuzzy solutionSlide 14Fuzzy setsExample: Crisp set TallExample: Fuzzy set TallMembership functions: S-functionMembership functions: P-FunctionSimple membership functionsOther representations of fuzzy setsFuzzy set operatorsExample fuzzy set operationsLinguistic HedgesFuzzy relationsFuzzy inferenceFuzzy logical operationsIf-Then RulesEvaluation of fuzzy rulesEvaluation of fuzzy rules (cont’d)Summary: If-Then rulesMultiple rulesmax-min rule of compositionDefuzzify the outputFuzzy inference overviewLimitations of fuzzy logicFuzzy tools and shellsCS 561, Sessions 20-211This time: Fuzzy Logic and Fuzzy Inference•Why use fuzzy logic?•Tipping example•Fuzzy set theory•Fuzzy inferenceCS 561, Sessions 20-212What is fuzzy logic?•A super set of Boolean logic•Builds upon fuzzy set theory•Graded truth. Truth values between True and False. Not everything is either/or, true/false, black/white, on/off etc.•Grades of membership. Class of tall men, class of far cities, class of expensive things, etc.•Lotfi Zadeh, UC/Berkely 1965. Introduced FL to model uncertainty in natural language. Tall, far, nice, large, hot, …•Reasoning using linguistic terms. Natural to express expert knowledge. If the weather is cold then wear warm clothingCS 561, Sessions 20-213Why use fuzzy logic?Pros:•Conceptually easy to understand w/ “natural” maths•Tolerant of imprecise data•Universal approximation: can model arbitrary nonlinear functions•Intuitive•Based on linguistic terms•Convenient way to express expert and common sense knowledgeCons:•Not a cure-all•Crisp/precise models can be more efficient and even convenient•Other approaches might be formally verified to workCS 561, Sessions 20-214Tipping example•The Basic Tipping Problem: Given a number between 0 and 10 that represents the quality of service at a restaurant what should the tip be?Cultural footnote: An average tip for a meal in the U.S. is 15%, which may vary depending on the quality of the service provided.CS 561, Sessions 20-215Tipping example: The non-fuzzy approach•Tip = 15% of total bill•What about quality of service?CS 561, Sessions 20-216Tipping example: The non-fuzzy approach•Tip = linearly proportional to service from 5% to 25%tip = 0.20/10*service+0.05•What about quality of the food?CS 561, Sessions 20-217Tipping example: Extended•The Extended Tipping Problem: Given a number between 0 and 10 that represents the quality of service and the quality of the food, at a restaurant, what should the tip be?How will this affect our tipping formula?CS 561, Sessions 20-218Tipping example: The non-fuzzy approach•Tip = 0.20/20*(service+food)+0.05•We want service to be more important than food quality. E.g., 80% for service and 20% for food.CS 561, Sessions 20-219Tipping example: The non-fuzzy approach•Tip = servRatio*(.2/10*(service)+.05) + servRatio = 80% (1-servRatio)*(.2/10*(food)+0.05);•Seems too linear. Want 15% tip in general and deviation only for exceptionally good or bad service.CS 561, Sessions 20-2110Tipping example: The non-fuzzy approachif service < 3, tip(f+1,s+1) = servRatio*(.1/3*(s)+.05) + ... (1-servRatio)*(.2/10*(f)+0.05);elseif s < 7,tip(f+1,s+1) = servRatio*(.15) + ... (1-servRatio)*(.2/10*(f)+0.05);else, tip(f+1,s+1) = servRatio*(.1/3*(s-7)+.15) + ... (1-servRatio)*(.2/10*(f)+0.05);end;CS 561, Sessions 20-2111Tipping example: The non-fuzzy approachNice plot but•‘Complicated’ function•Not easy to modify•Not intuitive•Many hard-coded parameters•Not easy to understandCS 561, Sessions 20-2112Tipping problem: the fuzzy approachWhat we want to express is:1. If service is poor then tip is cheap2. If service is good the tip is average3. If service is excellent then tip is generous4. If food is rancid then tip is cheap5. If food is delicious then tip is generousor1. If service is poor or the food is rancid then tip is cheap2. If service is good then tip is average3. If service is excellent or food is delicious then tip is generousWe have just defined the rules for a fuzzy logic system.CS 561, Sessions 20-2113Tipping problem: fuzzy solutionDecision function generated using the 3 rules.CS 561, Sessions 20-2114Tipping problem: fuzzy solution•Before we have a fuzzy solution we need to find out a) how to define terms such as poor, delicious, cheap, generous etc.b) how to combine terms using AND, OR and other connectivesc) how to combine all the rules into one final outputCS 561, Sessions 20-2115Fuzzy sets•Boolean/Crisp set A is a mapping for the elements of S to the set {0, 1}, i.e., A: S  {0, 1}•Characteristic function: A(x) ={1 if x is an element of set A0 if x is not an element of set A•Fuzzy set F is a mapping for the elements of S to the interval [0, 1], i.e., F: S  [0, 1]•Characteristic function: 0  F(x)  1•1 means full membership, 0 means no membership and anything in between, e.g., 0.5 is called graded membershipCS 561, Sessions 20-2116Example: Crisp set Tall•Fuzzy sets and concepts are commonly used in natural languageJohn is tallDan is smartAlex is happyThe class is hot•E.g., the crisp set Tall can be defined as {x | height x > 1.8 meters}But what about a person with a height = 1.79 meters?What about 1.78 meters?…What about 1.52 meters?CS 561, Sessions 20-2117Example: Fuzzy set Tall•In a fuzzy set a person with a height of 1.8 meters would be considered tall to a high degreeA person with a height of 1.7 meters would be considered tall to a lesser degree etc.•The function can changefor basketball players,Danes, women, children etc.CS 561, Sessions 20-2118Membership functions: S-function•The S-function can be used to define fuzzy sets•S(x, a, b, c) =•0 for x  a•2(x-a/c-a)2for a  x  b•1 – 2(x-c/c-a)2for b  x  c•1 for x  ca b cCS 561, Sessions 20-2119Membership functions: Function• (x, a, b) = •S(x, b-a, b-a/2, b) for x  b•1 – S(x, b, b+a/2, a+b) for x  bE.g., close (to a)b-a b+a/2b-a/2 b+aaaCS 561, Sessions 20-2120Simple membership functions•Piecewise linear: triangular etc.•Easier to represent and calculate  saves computationCS 561, Sessions 20-2121Other


View Full Document

USC CSCI 561 - session20-21

Download session20-21
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view session20-21 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view session20-21 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?