1 / 28

FUZZY LOGIC

FUZZY LOGIC. WHAT IS FUZZY LOGIC?. Definition of fuzzy Fuzzy – “not clear, distinct, or precise; blurred” Definition of fuzzy logic A form of knowledge representation suitable for notions that cannot be defined precisely, but which depend upon their contexts.

jerrod
Télécharger la présentation

FUZZY LOGIC

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. FUZZY LOGIC

  2. WHAT IS FUZZY LOGIC? • Definition of fuzzy • Fuzzy – “not clear, distinct, or precise; blurred” • Definition of fuzzy logic • A form of knowledge representation suitable for notions that cannot be defined precisely, but which depend upon their contexts.

  3. TRADITIONAL REPRESENTATION OF LOGIC Slow Fast Speed = 0 Speed = 1 bool speed; get the speed if ( speed == 0) { // speed is slow } else { // speed is fast }

  4. FUZZY LOGIC REPRESENTATION Slowest • For every problem must represent in terms of fuzzy sets. • What are fuzzy sets? [ 0.0 – 0.25 ] Slow [ 0.25 – 0.50 ] Fast [ 0.50 – 0.75 ] Fastest [ 0.75 – 1.00 ]

  5. FUZZY LOGIC REPRESENTATION CONT. Slowest Slow Fast Fastest float speed; get the speed if ((speed >= 0.0)&&(speed < 0.25)) { // speed is slowest } else if ((speed >= 0.25)&&(speed < 0.5)) { // speed is slow } else if ((speed >= 0.5)&&(speed < 0.75)) { // speed is fast } else // speed >= 0.75 && speed < 1.0 { // speed is fastest }

  6. ORIGINS OF FUZZY LOGIC • Traces back to Ancient Greece • Lotfi Asker Zadeh ( 1965 ) • First to publish ideas of fuzzy logic. • Professor Toshire Terano ( 1972 ) • Organized the world's first working group on fuzzy systems. • F.L. Smidth & Co. ( 1980 ) • First to market fuzzy expert systems.

  7. FUZZY LOGIC VS. NEURAL NETWORKS • How does a Neural Network work? • Both model the human brain. • Fuzzy Logic • Neural Networks • Both used to create behavioral systems.

  8. FUZZY LOGIC IN CONTROL SYSTEMS • Fuzzy Logic provides a more efficient and resourceful way to solve Control Systems. • Some Examples • Temperature Controller • Anti – Lock Break System ( ABS )

  9. TEMPERATURE CONTROLLER • The problem • Change the speed of a heater fan, based off the room temperature and humidity. • A temperature control system has four settings • Cold, Cool, Warm, and Hot • Humidity can be defined by: • Low, Medium, and High • Using this we can define the fuzzy set.

  10. BENEFITS OF USING FUZZY LOGIC

  11. FUZZY LOGIC IN OTHER FIELDS • Business • Hybrid Modeling • Expert Systems

  12. Application Predicting consumption of fuel in Automobiles.

  13. Training Data

  14. Partitioning Data • Input Selection exhsrch(1, trn_data, chk_data, input_name); Train 6 ANFIS models, each with 1 inputs selected from 6 candidates... ANFIS model 1: Cylinder --> trn=4.6400, chk=4.7255 ANFIS model 2: Disp --> trn=4.3106, chk=4.4316 ANFIS model 3: Power --> trn=4.5399, chk=4.1713 ANFIS model 4: Weight --> trn=4.2577, chk=4.0863 ANFIS model 5: Acceler --> trn=6.9789, chk=6.9317 ANFIS model 6: Year --> trn=6.2255, chk=6.1693

  15. Figure 1: Every input variable's influence on fuel consumption The left-most input variable in Figure 1 has the least error or in other words the most relevance with respect to the output.

  16. input_index = exhsrch(2, trn_data, chk_data, input_name); Train 15 ANFIS models, each with 2 inputs selected from 6 candidates... ANFIS model 1: Cylinder Disp --> trn=3.9320, chk=4.7920 ANFIS model 2: Cylinder Power --> trn=3.7364, chk=4.8683 ANFIS model 3: Cylinder Weight --> trn=3.8741, chk=4.6764 ANFIS model 4: Cylinder Acceler --> trn=4.3287, chk=5.9625 ANFIS model 5: Cylinder Year --> trn=3.7129, chk=4.5946 ANFIS model 6: Disp Power --> trn=3.8087, chk=3.8594 ANFIS model 7: Disp Weight --> trn=4.0271, chk=4.6349 ANFIS model 8: Disp Acceler --> trn=4.0782, chk=4.4890 ANFIS model 9: Disp Year --> trn=2.9565, chk=3.3905 ANFIS model 10: Power Weight --> trn=3.9310, chk=4.2974 ANFIS model 11: Power Acceler --> trn=4.2740, chk=3.8738 ANFIS model 12: Power Year --> trn=3.3796, chk=3.3505 ANFIS model 13: Weight Acceler --> trn=4.0875, chk=4.0095 ANFIS model 14: Weight Year --> trn=2.7657, chk=2.9954 ANFIS model 15: Acceler Year --> trn=5.6242, chk=5.6481

  17. Figure 2: All two input variable combinations and their influence on fuel consumption The results from exhsrch indicate that 'Weight' and 'Year' form the optimal combination of two input attributes. The training and checking errors are getting distinguished, indicating the outset of overfitting.

  18. exhsrch(3, trn_data, chk_data, input_name); Train 20 ANFIS models, each with 3 inputs selected from 6 candidates...

  19. Figure 3: All three input variable combinations and their influence on fuel consumption

  20. Training the ANFIS model The function exhsrch only trains each ANFIS for a single epoch in order to be able to quickly find the right inputs. Now that the inputs are fixed, we can spend more time on ANFIS training (100 epochs). The genfis1 function generates an initial FIS from the training data, which is then finetuned by ANFIS to generate the final model. in_fismat = genfis1(new_trn_data, 2, 'gbellmf'); [trn_out_fismat trn_error step_size chk_out_fismatchk_error] = ... anfis(new_trn_data, in_fismat, [100 nan 0.01 0.5 1.5], [0,0,0,0], new_ch k_data, 1); ANFIS returns the error with respect to training data and checking data in the list of its output parameters. The plot of the errors provides useful information about the training process. [a, b] = min(chk_error); plot(1:100, trn_error, 'g-', 1:100, chk_error, 'r-', b, a, 'ko'); title('Training (green) and checking (red) error curve'); xlabel('Epoch numbers'); ylabel('RMS errors');

  21. Figure 4: ANFIS training and checking errors

  22. Analyzing the ANFIS Model The variable chk_out_fismat represents the snapshot of the ANFIS model at the minimal checking error during the training process. The input-output surface of the model is shown in the plot below. chk_out_fismat = setfis(chk_out_fismat, 'input', 1, 'name', 'Weight'); chk_out_fismat = setfis(chk_out_fismat, 'input', 2, 'name', 'Year'); chk_out_fismat = setfis(chk_out_fismat, 'output', 1, 'name', 'MPG');

  23. % Generating the FIS output surface plot gensurf(chk_out_fismat); Figure 5: Input-Output surface for trained FIS

  24. Limitations and Cautions We can see some spurious effects at the far-end corner of the surface. The elevated corner says that the heavier an automobile is, the more gas-efficient it will be. This is totally counter-intuitive, and it is a direct result from lack of data. plot(new_trn_data(:,1), new_trn_data(:, 2), 'bo', new_chk_data(:,1), new_chk_data(:, 2), 'rx'); xlabel('Weight'); ylabel('Year'); title('Training (o) and checking (x) data');

  25. Figure 6: Weight vs Year plot showing lack of data in the upper-right corner This plot above shows the data distribution. The lack of training data at the upper right corner causes the spurious ANFIS surface mentioned earlier. Therefore the prediction by ANFIS should always be interpreted with the data distribution in mind.

  26. Fuzzy logic provides an alternative way to represent linguistic and subjective attributes of the real world in computing. • It allows membership degrees to the variables. • It is able to be applied to control systems and other applications in order to improve the efficiency and simplicity of the design process.

  27. Different cases of each input’s fuzzy sets are evaluated according to if-then rules of the fuzzy system • As a result of this operation, the optimum outputs are obtained much close to the target outputs

  28. Neural networks are adaptive networks which are • composed of simple elements operating in parallel • These elements are inspired by biological nervous • Systems • Neural networks have been trained to • perform complex functions in various fields of • applications including pattern recognition, • identification, classification, speech, vision and • control systems

More Related