Logical and Artificial Intelligence in Games Lecture 13

Slides:



Advertisements
Similar presentations
TWO STEP EQUATIONS 1. SOLVE FOR X 2. DO THE ADDITION STEP FIRST
Advertisements

(Fuzzy Set Operations)
Mathematical Preliminaries
인공지능 2002년 2학기 이복주 단국대학교 컴퓨터공학과
Fundamentals of Probability
Adders Used to perform addition, subtraction, multiplication, and division (sometimes) Half-adder adds rightmost (least significant) bit Full-adder.
1 Knowledge and reasoning – second part Knowledge representation Logic and representation Propositional (Boolean) logic Normal forms Inference in propositional.
© Negnevitsky, Pearson Education, Lecture 12 Hybrid intelligent systems: Evolutionary neural networks and fuzzy evolutionary systems Introduction.
© Negnevitsky, Pearson Education, Lecture 5 Fuzzy expert systems: Fuzzy inference Mamdani fuzzy inference Mamdani fuzzy inference Sugeno fuzzy inference.
Introductory Mathematics & Statistics for Business
Chapter 1 The Study of Body Function Image PowerPoint
and 6.855J Spanning Tree Algorithms. 2 The Greedy Algorithm in Action
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA
CS1512 Foundations of Computing Science 2 Week 3 (CSD week 32) Probability © J R W Hunter, 2006, K van Deemter 2007.
Solve Multi-step Equations
Fuzzy expert systems Fuzzy inference Mamdani fuzzy inference
Randomized Algorithms Randomized Algorithms CS648 1.
MAT 103 Probability In this chapter, we will study the topic of probability which is used in many different areas including insurance, science, marketing,
Copyright © 2013, 2009, 2005 Pearson Education, Inc.
VOORBLAD.
Hypothesis Tests: Two Independent Samples
How to convert a left linear grammar to a right linear grammar
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
1..
Traditional IR models Jian-Yun Nie.
© 2012 National Heart Foundation of Australia. Slide 2.
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
25 seconds left…...
Copyright © Cengage Learning. All rights reserved.
A set is a collection of objects A special kind of set Fuzzy Sets
Intelligent Control Methods Lecture 11: Fuzzy control 2 Slovak University of Technology Faculty of Material Science and Technology in Trnava.
Januar MDMDFSSMDMDFSSS
Determining How Costs Behave
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
PSSA Preparation.
Bart Jansen 1.  Problem definition  Instance: Connected graph G, positive integer k  Question: Is there a spanning tree for G with at least k leaves?
The Pumping Lemma for CFL’s
NON - zero sum games.
 Negnevitsky, Pearson Education, Lecture 5 Fuzzy expert systems: Fuzzy inference n Mamdani fuzzy inference n Sugeno fuzzy inference n Case study.
AI – CS364 Fuzzy Logic Fuzzy Logic 3 03 rd October 2006 Dr Bogdan L. Vrusias
Fuzzy Inference and Defuzzification
CS 561, Sessions This time: Fuzzy Logic and Fuzzy Inference Why use fuzzy logic? Tipping example Fuzzy set theory Fuzzy inference.
Fuzzy Expert Systems. Lecture Outline What is fuzzy thinking? What is fuzzy thinking? Fuzzy sets Fuzzy sets Linguistic variables and hedges Linguistic.
Final Exam: May 10 Thursday. If event E occurs, then the probability that event H will occur is p ( H | E ) IF E ( evidence ) is true THEN H ( hypothesis.
5/17/20151 Probabilistic Reasoning CIS 479/579 Bruce R. Maxim UM-Dearborn.
FUZZY Logic for Game Programmers
Fuzzy Expert System.
Chapter 18 Fuzzy Reasoning.
1 Chapter 18 Fuzzy Reasoning. 2 Chapter 18 Contents (1) l Bivalent and Multivalent Logics l Linguistic Variables l Fuzzy Sets l Membership Functions l.
WELCOME TO THE WORLD OF FUZZY SYSTEMS. DEFINITION Fuzzy logic is a superset of conventional (Boolean) logic that has been extended to handle the concept.
Fuzzy Logic. Lecture Outline Fuzzy Systems Fuzzy Sets Membership Functions Fuzzy Operators Fuzzy Set Characteristics Fuzziness and Probability.
Fuzzy Inference (Expert) System
Lógica difusa  Bayesian updating and certainty theory are techniques for handling the uncertainty that arises, or is assumed to arise, from statistical.
Fuzzy Sets and Control. Fuzzy Logic The definition of Fuzzy logic is a form of multi-valued logic derived frommulti-valued logic fuzzy setfuzzy set theory.
“Principles of Soft Computing, 2 nd Edition” by S.N. Sivanandam & SN Deepa Copyright  2011 Wiley India Pvt. Ltd. All rights reserved. CHAPTER 12 FUZZY.
1 Lecture 4 The Fuzzy Controller design. 2 By a fuzzy logic controller (FLC) we mean a control law that is described by a knowledge-based system consisting.
Artificial Intelligence CIS 342
Artificial Intelligence
Artificial Intelligence and Adaptive Systems
Fuzzy logic Introduction 3 Fuzzy Inference Aleksandar Rakić
FUZZIFICATION AND DEFUZZIFICATION
CIS 488/588 Bruce R. Maxim UM-Dearborn
Fuzzy Inference Systems
Presentation transcript:

Logical and Artificial Intelligence in Games Lecture 13 Fuzzy Logic Logical and Artificial Intelligence in Games Lecture 13

Set Logic Extended Fuzziness can be seen as an extension to Boolean set theory In classic logic, all set are crisp (true or false) Numbers are crisp also – meaning each concept is perfectly known and expressed as such E.g., health = 68, armor = 41

When is a pile of chalk big? If we have three pieces of chalk in the room is that considered a big pile of chalk? Some people might say, yes that is a big pile and some would not. Someplace between those three pieces of chalk and a whole room full of chalk the pile of chalk turns from a small pile into a big pile. This could be a different spot for different people.

Fuzzy Set Theory In ordinary set theory every element “x” from a given universe is either in or out of a set S x  S x  S In fuzzy set theory set membership is not so easily determined

Membership Function A: X  [0,1] x  A(x)  x  X A is the membership function X is universe of discourse Diagram below shows different fuzzy membership functions A – triangular B – Curve C – Crisp Singleton

Collection of Singletons Collection of ordered pairs (x, A(x)) known as a fuzzy singleton Consider a set A defined as the set of hostile game objects from X X = {door, gun, fred, bot1} a = [0 0 0.3 0.8] A = {(door,0), (gun,0), (fred, 0.3), (bot1, 0.8)}

Fuzzy Set Theoretic Operations Probability Theory Independent Events   Fuzzy Set Theoretic Operations Probability Theory Independent Events A(x) a B(x) b not A(x) complememt 1-a 1 - a A and B intersection min(a,b) a * b A or B union max(a,b) a + b – a*b A = B equality x: A(x) = B(x) A  B subset x: A(x) < B(x)

Fuzzy Modifiers - 1 In “very dangerous” the word “very” could be thought of as a fuzzy linguistic modifier dangerous = [0 0.1 0.4 0.8 1] very dangerous = [0 0.01 0.16 0.64 1] More formally we could think of a fuzzy modifier m as a function that converts one fuzzy set a into another set m(a) m: X  F(X) a  m(a) | a  F(X)

Fuzzy Modifiers - 2 Possible fuzzy definitions (restrictive) very(a) = a2 extremely(a) = a3 moreorless(a) = a1/2 slightly(a) = a1/3 exactly(a) = a+ always(a) = a0 Adverbs might be used as offset modifiers A(x) = m(A(x + k))

Fuzzy Variables and Values Fuzzy variables can be considered as a term associated with a floating point value A collection of fuzzy variables could be used to define an enemy profile {(healthy 0.9) (dangerous 0.3) (moving 0.3)} Linguistic variables is a collection of fuzzy variables used to de

Liguistic Variables Linguistic variables is a collection of fuzzy variables used to define a high level concept like “allegiance” term set: {enemy,neutral,friendly} values: [0.0, 0.4, 0.9] A linguistic variable is defined over a base variable Base variables can be either crisp or fuzzy values

Fuzzification Creating a fuzzy variable from a crisp one Define a membership function with the same range as the crisp variable Evaluating the membership based on the crisp variable value indicates degree of set membership

Defuzzification - 1 Converts a fuzzy value to a crisp value Fairly easy for fuzzy variables Can be tricky for linguistic values Process often involves information loss, unless you are doing simple conversions There is no unique equation, since humans use problem- dependent techniques to defuzzify linguistic concepts

Defuzzification - 2 Maximum Approach Centroid Approach Uses highest points in membership function graph First maxima – picks crisp value from highest of all membership function Average maxima – weighted or unweighted average of all crisp values Centroid Approach based on finding center of gravity of the membership function graph Very computationally intensive

Fuzzy Logical Operators The concepts of fuzzy logic are similar to those used in fuzzy set theory. Operator Notation Equation NOT  1 – x AND  min(x, y) OR  max(x, y) IMPLIES  max(1 - x, y) max(0, x + y – 1)

Linguistic Expressions Dead or alive Extremely nasty and more or less dead Shot and bleeding badly implies dying d  a n3  d1/2 s  b2  d

Fuzzy Logic Fuzziness is really deterministic uncertainty and depends on probability assumptions which may not be met Fuzzy logic contains inconsistencies (e.g. the set of animats that are both dead and alive is not empty) Seems to model human knowledge and reasoning better than standard truth functional logic

Fuzzy Control Systems Decision Making Working Memory Similar to RBS, except fuzzy variables used in place of crisp symbols Knowledge Base Rules containing fuzzy variables are used, e.g., IF very confident or somewhat vulnerable THEN attack

Rule Extensions Linguistic rules Fuzzy modifiers Keyword is used to refer to fuzzy terms if allegiance is friendly then happy Fuzzy modifiers Can be applied to both antecedent and consequent variables

Creating Membership Functions Knowledge engineer can try to extract information and heuristics from human experts Survey can be used to collect information regarding several people’s understanding and membership function reflects average Incremental tuning will be required for any approach chosen

Fuzzy Interpreter Matching In crisp systems it is easy to identify rules that match WM, facts are present or they are not In fuzzy systems, fuzzy variables are rarely zero so every rule needs to be checked during every match cycle To reduce impact of combinatorial explosion, thresholds will be used to reduce the number of low probability matches

Fuzzy Interpreter Inference Purpose is to determine the degree of truth for the consequent part of each rule Two techniques used Min – uses the minimum of the rule antecedent values and treats this as the value for the output set – possibilistic reasoning Product – uses the product of the rule antecedent values and treats this as the value for the output set – probabilistic reasoning

Fuzzy Interpreter Composition Many rules have the same fuzzy variable in the rule body (consequent) To combine support shown by multiple rules Max – uses the maximum of the rule output values and uses this as the fuzzy variable value in WM – possibilistic reasoning Sum – uses the sum of the rule output values and uses this as the fuzzy variable value in WM – probabilistic reasoning Sum A B

Algorithm // current WM with latest fuzzy variable values // previous is copy of most recent WM for each value in WM { previous[value] = current[value]; current[value] = 0; } for each rule result = evaluate(rule.expression,previous); current[rule/body] = max(current[rule.body},result);

Discussion – 1 Fuzzy systems are surprisingly robust Can cope with noisy and incomplete data Requires little feedback to perform well Fuzzy expert systems mimic human reasoning surprisingly well Fuzzy RBS are easy to extend incrementally Rule syntax is easy enough for non-programmers to write rules

Discussion – 2 Fuzzy systems use rules of thumb (heuristics) and not mathematical models of the problem Every rule needs to be evaluated during every match cycle which is computationally expensive (for a large number of rules) Creating membership functions is not easy Combinatorial explosion of rules is possible for large numbers of input combinations, unless knowledge is represented implicitly