Introduction to Neural Networks and Fuzzy Logic Lecture

  • Slides: 24
Download presentation
Introduction to Neural Networks and Fuzzy Logic Lecture 10 Dr. -Ing. Erwin Sitompul President

Introduction to Neural Networks and Fuzzy Logic Lecture 10 Dr. -Ing. Erwin Sitompul President University http: //zitompul. wordpress. com 2 0 1 8 President University Erwin Sitompul NNFL 10/1

Fuzzy Logic Membership Function Homework 9 Min “Temperature is low” AND “Temperature is middle”

Fuzzy Logic Membership Function Homework 9 Min “Temperature is low” AND “Temperature is middle” Max “Temperature is low” OR “Temperature is middle” President University Erwin Sitompul NNFL 10/2

Fuzzy Logic Membership Function Homework 9 Algebraic product “Temperature is low” AND “Temperature is

Fuzzy Logic Membership Function Homework 9 Algebraic product “Temperature is low” AND “Temperature is middle” Algebraic sum “Temperature is low” OR “Temperature is middle” President University Erwin Sitompul NNFL 10/3

Fuzzy Logic Membership Function Homework 9 Bounded product “Temperature is low” AND “Temperature is

Fuzzy Logic Membership Function Homework 9 Bounded product “Temperature is low” AND “Temperature is middle” Bounded sum “Temperature is low” OR “Temperature is middle” President University Erwin Sitompul NNFL 10/4

Fuzzy Logic Fuzzy Control Further Fuzzy Set Operations Dilation Concentration President University Erwin Sitompul

Fuzzy Logic Fuzzy Control Further Fuzzy Set Operations Dilation Concentration President University Erwin Sitompul NNFL 10/5

Fuzzy Logic Fuzzy Control Loop President University Erwin Sitompul NNFL 10/6

Fuzzy Logic Fuzzy Control Loop President University Erwin Sitompul NNFL 10/6

Fuzzy Logic Fuzzy Control Fuzzy Inference n Prior to fuzzy control, the followings must

Fuzzy Logic Fuzzy Control Fuzzy Inference n Prior to fuzzy control, the followings must be defined: n Fuzzy membership functions n Fuzzy logic operators n Fuzzy rules, including fuzzy linguistic value and linguistic variable n The processing steps in a fuzzy control include: n Fuzzification n Implication / Inference Core n Accumulation n Defuzzification President University Erwin Sitompul NNFL 9/7

Fuzzy Logic Fuzzy Control Fuzzy Rules n Example of a fuzzy rule while “Driving

Fuzzy Logic Fuzzy Control Fuzzy Rules n Example of a fuzzy rule while “Driving a Car”: “IF the distance to the car in front is small, AND the distance is decreasing slowly, THEN decelerate quite big” n The question that arises: Given a certain distance and a certain change of distance, what (crisp) value of acceleration should we select? President University Erwin Sitompul NNFL 10/8

Fuzzy Logic Fuzzy Control Definition of Fuzzy Membership Functions v. small perfect big v.

Fuzzy Logic Fuzzy Control Definition of Fuzzy Membership Functions v. small perfect big v. slow moderate fast very fast Distance –big Distance decrease –small zero +small +big Acceleration President University Erwin Sitompul NNFL 10/9

Fuzzy Logic Fuzzy Control Fuzzification Observation/ measurement v. small perfect big v. slow moderate

Fuzzy Logic Fuzzy Control Fuzzification Observation/ measurement v. small perfect big v. slow moderate fast very fast Distance –big Distance decrease –small zero +small +big • Distance between small and perfect • Distance decrease can be moderate or fast • What acceleration should be applied? Acceleration President University Erwin Sitompul NNFL 10/10

Fuzzy Logic Fuzzy Control Implication of Rules Observation/ measurement v. small perfect big v.

Fuzzy Logic Fuzzy Control Implication of Rules Observation/ measurement v. small perfect big v. big –small zero +small +big 0. 55 Distance Acceleration Inference core: Clipping RULE 1: IF distance is small Clip the fuzzy membership THEN decelerate small function of “–small” at the height given by the premises (0. 55). Later, the clipped area will be considered in the final decision President University Erwin Sitompul NNFL 9/11

Fuzzy Logic Fuzzy Control Implication of Rules Observation/ measurement v. slow moderate fast very

Fuzzy Logic Fuzzy Control Implication of Rules Observation/ measurement v. slow moderate fast very fast –big –small zero +small +big 0. 7 Distance decrease RULE 2: IF distance decrease is moderate THEN keep the speed President University Acceleration Inference core: Clipping Clip the fuzzy membership function of “zero” at the height given by the premises (0. 7). Later, the clipped area will be considered in the final decision Erwin Sitompul NNFL 9/12

Fuzzy Logic Fuzzy Control Accumulation n From each rule, a clipped area is obtained.

Fuzzy Logic Fuzzy Control Accumulation n From each rule, a clipped area is obtained. But, in the end only one single output is wanted. How do we make a final decision? –big –small zero +small +big Rule 1 Rule 2 Acceleration n In the accumulation (aggregation) step, all clipped areas are merged into one merged area (taking the union). n Rules with high premises will contribute large clipped area to the merged area. These rules will “pull” that merged area towards their own central value. President University Erwin Sitompul NNFL 10/13

Fuzzy Logic Fuzzy Control Defuzzification –big –small zero +small +big Acceleration Center of gravity

Fuzzy Logic Fuzzy Control Defuzzification –big –small zero +small +big Acceleration Center of gravity Crisp value n In this last step, the returned value is the wanted acceleration. n Out of many possible ways, the center of gravity is the commonly used method in defuzzification. President University Erwin Sitompul NNFL 9/14

Fuzzy Logic Fuzzy Control Inference Core n There are two approaches that can be

Fuzzy Logic Fuzzy Control Inference Core n There are two approaches that can be used for inference core: 1. Clipping approach: 0. 55 Min-Operator acceleration Membership function Fuzzification value 2. Scaling approach: 0. 55 Algebraic Product acceleration President University Erwin Sitompul NNFL 10/15

Fuzzy Logic Fuzzy Control Review on Center of Gravity Rectangle President University Triangle Erwin

Fuzzy Logic Fuzzy Control Review on Center of Gravity Rectangle President University Triangle Erwin Sitompul NNFL 9/16

Fuzzy Logic Fuzzy Control Review on Center of Gravity Isosceles Trapezoid President University Trapezoid

Fuzzy Logic Fuzzy Control Review on Center of Gravity Isosceles Trapezoid President University Trapezoid Erwin Sitompul NNFL 9/17

Fuzzy Logic Fuzzy Control Summary of Fuzzy Control 1. Fuzzify inputs, determine the degree

Fuzzy Logic Fuzzy Control Summary of Fuzzy Control 1. Fuzzify inputs, determine the degree of membership for all terms in the premise. 2. Apply fuzzy logic operators, if there are multiple terms in the premise (min-max, algebraic, bounded). 3. Apply inference core (clipping, scaling, etc. ) 4. Accumulate all outputs (union operation i. e. max, sum, etc. ) 5. Defuzzify (center of gravity of the merged outputs, max-method, modified center of gravity, height method, etc) President University Erwin Sitompul NNFL 10/18

Fuzzy Logic Fuzzy Control Limitations of Fuzzy Control n Definition and fine-tuning of membership

Fuzzy Logic Fuzzy Control Limitations of Fuzzy Control n Definition and fine-tuning of membership functions need experience (covered range, number of MFs, shape). n Defuzzification may produce undesired results (needs redefinition of membership functions). President University Erwin Sitompul NNFL 10/19

Fuzzy Logic Fuzzy Control Homework 10 n A fuzzy controller is to be used

Fuzzy Logic Fuzzy Control Homework 10 n A fuzzy controller is to be used in driving a car. The fuzzy membership functions for the two inputs and one output are defined as below. v. small perfect big v. big declining constant 1 growing 1 0 5 10 15 20 25 Distance to next car [m] –big – 10 – 5 0 5 10 2 Speed change [m/s ] –small zero +small +big 1 – 2 – 1 0 1 2 2 Acceleration adj. [m/s ] President University Erwin Sitompul NNFL 10/20

Fuzzy Logic Fuzzy Control Homework 10 (Cont. ) n A fuzzy controller is to

Fuzzy Logic Fuzzy Control Homework 10 (Cont. ) n A fuzzy controller is to be used in driving a car. The fuzzy rules are given as follows. Rule 1: IF distance is small AND speed is declining, THEN maintain acceleration. Rule 2: IF distance is small AND speed is constant, THEN acceleration adjustment negative small. Rule 3: IF distance is perfect AND speed is declining, THEN acceleration adjustment positive small. Rule 4: IF distance is perfect AND speed is constant, THEN maintain acceleration. President University Erwin Sitompul NNFL 10/21

Fuzzy Logic Fuzzy Control Homework 10 (Cont. ) n Using Min-Max as fuzzy operators,

Fuzzy Logic Fuzzy Control Homework 10 (Cont. ) n Using Min-Max as fuzzy operators, clipping as inference core, union operator as accumulator, and center of gravity method as defuzzifier, find the output of the controller if the measurements confirms that distance to next car is 13 m and the speed is increasing by 2. 5 m/s 2. President University Erwin Sitompul NNFL 10/22

Fuzzy Logic Fuzzy Control Homework 10 A n A driver of an open-air car

Fuzzy Logic Fuzzy Control Homework 10 A n A driver of an open-air car determine how fast he drives based on the air temperature and the sky conditions. The corresponding fuzzy membership functions can be seen here. President University Erwin Sitompul NNFL 10/23

Fuzzy Logic Fuzzy Control Homework 10 A (Cont. ) n After years of experience,

Fuzzy Logic Fuzzy Control Homework 10 A (Cont. ) n After years of experience, he summarizes his personal driving rules as follows: Rule 1: IF it is sunny AND warm, THEN drive fast. Rule 2: IF it is partly cloudy AND hot, THEN drive slow. Rule 3: IF it is partly cloudy, THEN drive fast. n You are now assigned to design a fuzzy control with the following requirements: n Fuzzy logic operators: algebraic sum / product n Inference core: scaling n Accumulator: union operator n Defuzzification: center of gravity method n The speed limit is 120 km/h. How fast will the driver go if in one day the temperature is 65 °F and the cloud cover is 25 %? n Deadline: Sunday, 25 March 2018. President University Erwin Sitompul NNFL 10/24