CS 354R: Computer Game Technology

Similar documents
MYCIN. The MYCIN Task

Module 12. Machine Learning. Version 2 CSE IIT, Kharagpur

Lecture 1: Basic Concepts of Machine Learning

Software Maintenance

A Version Space Approach to Learning Context-free Grammars

Axiom 2013 Team Description Paper

Knowledge based expert systems D H A N A N J A Y K A L B A N D E

Introduction to Ensemble Learning Featuring Successes in the Netflix Prize Competition

On-Line Data Analytics

Machine Learning and Data Mining. Ensembles of Learners. Prof. Alexander Ihler

LEGO MINDSTORMS Education EV3 Coding Activities

Rule Learning With Negation: Issues Regarding Effectiveness

CS Machine Learning

OPTIMIZATINON OF TRAINING SETS FOR HEBBIAN-LEARNING- BASED CLASSIFIERS

Machine Learning from Garden Path Sentences: The Application of Computational Linguistics

Cognitive Modeling. Tower of Hanoi: Description. Tower of Hanoi: The Task. Lecture 5: Models of Problem Solving. Frank Keller.

ReinForest: Multi-Domain Dialogue Management Using Hierarchical Policies and Knowledge Ontology

(Sub)Gradient Descent

An Investigation into Team-Based Planning

Rule Learning with Negation: Issues Regarding Effectiveness

A Neural Network GUI Tested on Text-To-Phoneme Mapping

Lecture 1: Machine Learning Basics

have to be modeled) or isolated words. Output of the system is a grapheme-tophoneme conversion system which takes as its input the spelling of words,

An OO Framework for building Intelligence and Learning properties in Software Agents

Rule-based Expert Systems

TD(λ) and Q-Learning Based Ludo Players

AQUA: An Ontology-Driven Question Answering System

Computer Science. Embedded systems today. Microcontroller MCR

Chapter 2 Rule Learning in a Nutshell

Iterative Cross-Training: An Algorithm for Learning from Unlabeled Web Pages

Version Space. Term 2012/2013 LSI - FIB. Javier Béjar cbea (LSI - FIB) Version Space Term 2012/ / 18

GACE Computer Science Assessment Test at a Glance

Neuro-Symbolic Approaches for Knowledge Representation in Expert Systems

Computer Organization I (Tietokoneen toiminta)

Grammars & Parsing, Part 1:

M55205-Mastering Microsoft Project 2016

Rover Races Grades: 3-5 Prep Time: ~45 Minutes Lesson Time: ~105 minutes

Learning goal-oriented strategies in problem solving

Learning Cases to Resolve Conflicts and Improve Group Behavior

Proof Theory for Syntacticians

Rule Chaining in Fuzzy Expert Systems

Course Content Concepts

SYSTEM ENTITY STRUCTUURE ONTOLOGICAL DATA FUSION PROCESS INTEGRAGTED WITH C2 SYSTEMS

Cooperative evolutive concept learning: an empirical study

Active Learning. Yingyu Liang Computer Sciences 760 Fall

"f TOPIC =T COMP COMP... OBJ

AC : DESIGNING AN UNDERGRADUATE ROBOTICS ENGINEERING CURRICULUM: UNIFIED ROBOTICS I AND II

An Introduction to the Minimalist Program

We are strong in research and particularly noted in software engineering, information security and privacy, and humane gaming.

Laboratorio di Intelligenza Artificiale e Robotica

Introduction to Simulation

The open source development model has unique characteristics that make it in some

Getting Started with Deliberate Practice

CS 598 Natural Language Processing

Ontologies vs. classification systems

Automating the E-learning Personalization

Commanding Officer Decision Superiority: The Role of Technology and the Decision Maker

Constructive Induction-based Learning Agents: An Architecture and Preliminary Experiments

Learning and Transferring Relational Instance-Based Policies

COMPUTATIONAL COMPLEXITY OF LEFT-ASSOCIATIVE GRAMMAR

Mastering Team Skills and Interpersonal Communication. Copyright 2012 Pearson Education, Inc. publishing as Prentice Hall.

Laboratorio di Intelligenza Artificiale e Robotica

Using dialogue context to improve parsing performance in dialogue systems

Developing True/False Test Sheet Generating System with Diagnosing Basic Cognitive Ability

Multisensor Data Fusion: From Algorithms And Architectural Design To Applications (Devices, Circuits, And Systems)

Using Genetic Algorithms and Decision Trees for a posteriori Analysis and Evaluation of Tutoring Practices based on Student Failure Models

The stages of event extraction

Evolutive Neural Net Fuzzy Filtering: Basic Description

Modeling user preferences and norms in context-aware systems

SARDNET: A Self-Organizing Feature Map for Sequences

A Decision Tree Analysis of the Transfer Student Emma Gunu, MS Research Analyst Robert M Roe, PhD Executive Director of Institutional Research and

FUZZY EXPERT. Dr. Kasim M. Al-Aubidy. Philadelphia University. Computer Eng. Dept February 2002 University of Damascus-Syria

Data Fusion Models in WSNs: Comparison and Analysis

Number Line Moves Dash -- 1st Grade. Michelle Eckstein

Unit purpose and aim. Level: 3 Sub-level: Unit 315 Credit value: 6 Guided learning hours: 50

Mike Cohn - background

Seminar - Organic Computing

Notes on The Sciences of the Artificial Adapted from a shorter document written for course (Deciding What to Design) 1

Speeding Up Reinforcement Learning with Behavior Transfer

Grammar Lesson Plan: Yes/No Questions with No Overt Auxiliary Verbs

Houghton Mifflin Online Assessment System Walkthrough Guide

Faculty Schedule Preference Survey Results

UNDERSTANDING DECISION-MAKING IN RUGBY By. Dave Hadfield Sport Psychologist & Coaching Consultant Wellington and Hurricanes Rugby.

EECS 571 PRINCIPLES OF REAL-TIME COMPUTING Fall 10. Instructor: Kang G. Shin, 4605 CSE, ;

ENME 605 Advanced Control Systems, Fall 2015 Department of Mechanical Engineering

The IDN Variant Issues Project: A Study of Issues Related to the Delegation of IDN Variant TLDs. 20 April 2011

WSU Five-Year Program Review Self-Study Cover Page

Exploration. CS : Deep Reinforcement Learning Sergey Levine

Informatics 2A: Language Complexity and the. Inf2A: Chomsky Hierarchy

MULTIMEDIA Motion Graphics for Multimedia

Guide to Teaching Computer Science

Creating Your Term Schedule

CS 446: Machine Learning

Multimedia Application Effective Support of Education

Predicting Students Performance with SimStudent: Learning Cognitive Skills from Observation

Interactive Whiteboard

Writing Research Articles

Chinese Language Parsing with Maximum-Entropy-Inspired Parser

Aspectual Classes of Verb Phrases

How to Do Research. Jeff Chase Duke University

Transcription:

CS 354R: Computer Game Technology AI Decision Trees and Rule Systems Fall 2017

Decision Trees Nodes represent attribute tests One child for each outcome Leaves represent classifications Can have same classification across leaves Classify by descending from root to a leaf Perform test and descend Return leaf s classification (action) Decision tree is a disjunction of conjunctions of constraints on the attribute values of an instance Action if (A and B and C) or (A and ~B and D) or ( ) Retreat if (low health and see enemy) or (low health and hear enemy) or ( ) 2

Decision Tree for Quake Just one tree Attributes: Enemy=<t,f> Low=<t,f> Sound=<t,f> Death=<t,f> Actions: Attack, Retreat, Chase, Spawn, Wander D? t f Spawn E? t f t L? S? f t f Retreat Attack L? t f Wander Retreat Chase 3

Decision Tree for Quake Could add additional trees If I m attacking, which weapon should I use? If I m wandering, which way should I go? Can be thought of as just extending given tree Or, can share pieces of tree, such as a Retreat sub-tree D? t f Spawn E? t f L? S? t f t f Retreat Attack L? t f Wander Retreat Chase 4

Compare and Contrast Wander-L -E,-D,-S,L S Attack-E E,-D,-S,-L E E E -S L -L Attack-ES E,-D,S,-L -L L Retreat-S -E,-D,S,L -L L -E E Retreat-ES E,-D,S,L L -L -S S Wander -E,-D,-S,-L D -E D D Spawn D (-E,-S,-L) D -E E S Chase -E,-D,S,-L Retreat-E E,-D,-S,L 5

Different Trees Same Decision S? t f L? L? t f t f Retreat E? E? E? t f t f t Attack Chase Retreat D? D? t f t f Spawn Wander Spawn Attack f D? t Spawn f Wander 6

Handling Simultaneous Actions Treat each output command as a separate classification problem Given inputs should walk => <forward, backward, stop> Given inputs should turn => <left, right, none> Given inputs should run => <yes, no> Given inputs should weapon => <blaster, shotgun > Given inputs should fire => <yes, no> Have a separate tree for each command If commands are not independent, two options: Have a general conflict resolution strategy Put dependent actions in one tree 7

Deciding on Actions Each time the AI is called: Poll each decision tree for current output Event driven - only call when state changes Need current value of each input attribute All sensor inputs describe the state of the world Store the state of the environment Most recent values for all sensor inputs Change state upon receipt of a message Or, check validity when AI is updated Or, a mix of both (polling and event driven) 8

Sense, Think, Act Cycle Sense Gather input sensor changes Update state with new values Think Poll each decision tree Act Execute any changes to actions Sense Think Act 9

Building Decision Trees Decision trees can be constructed by hand Think of the questions you would ask to decide what to do For example: Tonight I can study, play games or sleep. How do I make my decision? But, decision trees are typically learned: Provide examples: many sets of attribute values and resulting actions Algorithm then constructs a tree from the examples Reasoning: We don t know how to decide on an action, so let the computer do the work 10

Learning Decision Trees Decision trees are usually learned by induction Generalize from examples Induction doesn t guarantee correct decision trees Bias towards smaller decision trees Occam s Razor: Prefer simplest theory that fits the data Too expensive to find the very smallest decision tree Learning is non-incremental Need to store all the examples ID3 is the basic learning algorithm C4.5 is an updated and extended version 11

Induction If X is true in every example that results in action A, then X must always be true for action A More examples are better Errors in examples cause difficulty If X is true in most examples X must always be true D3 does a good job of handling errors (noise) in examples Note that induction can result in errors It may just be coincidence that X is true in all the examples Typical decision tree learning determines what tests are always true for each action Assumes that if those things are true again, then the same action should result 12

Learning Algorithms Recursive algorithms Find an attribute test that separates the actions Divide the examples based on the test Recurse on the subsets What does it mean to separate? Ideally, there are no actions that have examples in both sets Failing that, most actions have most examples in one set The thing to measure is entropy - the degree of homogeneity (or lack of it) in a set Entropy is also important for compression 13

Induction Requires Examples Where do examples come from? Programmer/designer provides examples Capture an expert player s actions, and the game state, while they play # of examples needed depends on difficulty of concept Difficulty: Number of tests needed to determine the action More is always better Training set vs. Testing set Train on most (75%) of the examples Use the rest to validate the learned decision trees by estimating how well the tree does on examples it hasn t seen 14

Decision Tree Advantages Simpler, more compact representation State is recorded in a memory Create internal sensors Enemy-Recently-Sensed Easy to create and understand Decision trees can be learned 15

Decision Tree Disadvantages Decision tree engine requires more coding than FSM Need as many examples as possible Higher CPU cost (but not much higher) Learned decision trees may contain errors 16

References and Further Reading Mitchell: Machine Learning, McGraw Hill, 1997 Russell and Norvig: Artificial Intelligence: A Modern Approach, Prentice Hall, 1995 Quinlan: Induction of decision trees, Machine Learning 1:81-106, 1986 Quinlan: Combining instance-based and model-based learning,10th International Conference on Machine Learning, 1993 17

Rule-Based Systems Decision trees can be converted into rules More general rule-based systems let you write the rules System consists of: A rule set - the rules to evaluate A working memory - stores state A matching scheme - decides which rules are applicable A conflict resolution scheme - if more than one rule is applicable, decides how to proceed What types of games make the most extensive use of rules? 18

Rule-Based Systems Structure Match Rule Memory Program Procedural Knowledge Act Conflict Resolution Long-term Knowledge Working Memory Data Declarative Knowledge Short-term Knowledge 19

AI Cycle Sensing Memory Match Game Changes to Working Memory Rule instantiations that match working memory Actions Act Selected Rule Conflict Resolution 20

Age of Kings ; The AI will attack once at 1100 seconds and then again ; every 1400 sec, provided it has enough defense soldiers. (defrule => (defrule => (game-time > 1100) (attack-now) (enable-timer 7 1400)) (timer-triggered 7) (defend-soldier-count >= 12) (attack-now) (disable-timer 7) (enable-timer 7 1400)) Rule Action 21

Age of Kings (defrule => (defrule => (true) (enable-timer 4 3600) (disable-self)) (timer-triggered 4) (cc-add-resource food 700) (cc-add-resource wood 700) (cc-add-resource gold 700) (disable-timer 4) (enable-timer 4 2700) (disable-self)) What is it doing? 22

Implementing Rule-Based Systems Where does the time go? 90-95% goes to Match Matching all rules against all of working memory each cycle is way too slow Key observation # of changes to working memory each cycle is small If conditions, and hence rules, can be associated with changes, then we can make things fast (event-driven) Memory Act Match Conflict Resolution 23

General Case Rules can be arbitrarily complex In particular: function calls in conditions and actions If we have arbitrary function calls in conditions: Can t hash based on changes Run through rules one at a time and test conditions Pick the first one that matches (or do something else) Time to match depends on: Number of rules Complexity of conditions Number of rules that don t match 24

Resolving Multiple Matches Rule order pick the first rule that matches Makes order of loading important not good for big systems Rule specificity - pick the most specific rule Rule importance pick rule with highest priority When a rule is defined, give it a priority number Forces a total order on the rules is right 80% of the time Decide Rule 4 [80] is better than Rule 7 [70] Decide Rule 6 [85] is better than Rule 5 [75] Enforces ordering between all of them 25

Reducing Cost of Matching Save intermediate match information (RETE) Memory intensive Fast search DAGs that represent high-level rule sets Tuples of facts matched against hierarchy of rules Relevant facts asserted in working memory Recompute match for rules affected by change (TREAT) Memory efficient May be faster than RETE Make extensive use of hashing (mapping between memory and tests/rules) 26

Rule-based System: Advantages Corresponds to way people often think of knowledge Very expressive Modular knowledge Easier to write and debug compared to decision trees More concise than FSMs 27

Rule-based System: Disadvantages Can be memory intensive Can be computationally intensive Can be difficult to debug 28

Further Reading RETE: Forgy, C. L. Rete: A fast algorithm for the many pattern/ many object pattern match problem. Artificial Intelligence, 19(1) 1982, pp. 17-37 TREAT: Miranker, D. TREAT: A new and efficient match algorithm for AI production systems. Pittman/Morgan Kaufman, 1989 29