agents

Document Sample
agents Powered By Docstoc
					              Introduction




Introduction to Artificial Intelligence

              Steven Bethard
          Department of Computer Science
              University of Colorado


                  CSCI 3202




                                           1 / 30
                                     Who is teaching this course?
                                     Who is taking this course?
                      Introduction
                                     What is the course about?
                                     What are the course requirements?


Who is teaching this course?


 Steven Bethard, Ph.D.
     A.k.a. Steve
     University of Colorado, 2007
     Research:
         Statistical natural language processing
         Machine learning for educational tools




                                                                         2 / 30
                                      Who is teaching this course?
                                      Who is taking this course?
                       Introduction
                                      What is the course about?
                                      What are the course requirements?


Who is taking this course?


 Index Card Information
   1   Your name
   2   Your major(s)
   3   Why you’re interested in AI
   4   What you expect to learn in this course
   5   How comfortable you are with data structures,
       e.g. hash tables, priority queues, graphs



                                                                          3 / 30
                                     Who is teaching this course?
                                     Who is taking this course?
                      Introduction
                                     What is the course about?
                                     What are the course requirements?


What is the course about?


 Intelligent Agents
      Are autonomous
      Perceive their environment
      React to their environment
      Adapt to their environment
      Are rational




                                                                         4 / 30
                                     Who is teaching this course?
                                     Who is taking this course?
                      Introduction
                                     What is the course about?
                                     What are the course requirements?


General Information

 Times
     Class Tue, Thu 12:30-1:45pm
     Office Mon 10-11:30am, Thu 2-3:00pm

 Textbook
 Artificial Intelligence: A Modern Approach
 Stuart Russell and Peter Norvig
 Second Edition - Green, not red!

 Moodle
 http://moodle.cs.colorado.edu/

                                                                         5 / 30
                                     Who is teaching this course?
                                     Who is taking this course?
                      Introduction
                                     What is the course about?
                                     What are the course requirements?


General Information

 Times
     Class Tue, Thu 12:30-1:45pm
     Office Mon 10-11:30am, Thu 2-3:00pm

 Textbook
 Artificial Intelligence: A Modern Approach
 Stuart Russell and Peter Norvig
 Second Edition - Green, not red!

 Moodle
 http://moodle.cs.colorado.edu/

                                                                         5 / 30
                                     Who is teaching this course?
                                     Who is taking this course?
                      Introduction
                                     What is the course about?
                                     What are the course requirements?


General Information

 Times
     Class Tue, Thu 12:30-1:45pm
     Office Mon 10-11:30am, Thu 2-3:00pm

 Textbook
 Artificial Intelligence: A Modern Approach
 Stuart Russell and Peter Norvig
 Second Edition - Green, not red!

 Moodle
 http://moodle.cs.colorado.edu/

                                                                         5 / 30
                                     Who is teaching this course?
                                     Who is taking this course?
                      Introduction
                                     What is the course about?
                                     What are the course requirements?


General Information

 Times
     Class Tue, Thu 12:30-1:45pm
     Office Mon 10-11:30am, Thu 2-3:00pm

 Textbook
 Artificial Intelligence: A Modern Approach
 Stuart Russell and Peter Norvig
 Second Edition - Green, not red!

 Moodle
 http://moodle.cs.colorado.edu/

                                                                         5 / 30
                                    Who is teaching this course?
                                    Who is taking this course?
                     Introduction
                                    What is the course about?
                                    What are the course requirements?


Grading
 Assignments
     Python programming
     1-3 weeks
     Turned in through Moodle
     -2 points per day late

 Quizzes
     In-class
     30 minutes

 Participation
 Come prepared to discuss the readings
                                                                        6 / 30
                                    Who is teaching this course?
                                    Who is taking this course?
                     Introduction
                                    What is the course about?
                                    What are the course requirements?


Grading
 Assignments
     Python programming
     1-3 weeks
     Turned in through Moodle
     -2 points per day late

 Quizzes
     In-class
     30 minutes

 Participation
 Come prepared to discuss the readings
                                                                        6 / 30
                                    Who is teaching this course?
                                    Who is taking this course?
                     Introduction
                                    What is the course about?
                                    What are the course requirements?


Grading
 Assignments
     Python programming
     1-3 weeks
     Turned in through Moodle
     -2 points per day late

 Quizzes
     In-class
     30 minutes

 Participation
 Come prepared to discuss the readings
                                                                        6 / 30
                                  Who is teaching this course?
                                  Who is taking this course?
                   Introduction
                                  What is the course about?
                                  What are the course requirements?


Grading

 Final Grade
   5% Homework 1: Agents
  15% Homework 2: Search
  15% Homework 3: Probability
  15% Homework 4: Learning
  10% Quiz 1: Search
  10% Quiz 2: Logic
  10% Quiz 3: Probability
  10% Quiz 4: Learning
  10% Class Participation


                                                                      7 / 30
                                     Who is teaching this course?
                                     Who is taking this course?
                      Introduction
                                     What is the course about?
                                     What are the course requirements?


Additional Policies


  See the course webpage for info about:
      Disability Accomodations
      Religious Accomodations
      Classroom Behavior
      Descrimination and Harassment
      Honor Code




                                                                         8 / 30
                                     Who is teaching this course?
                                     Who is taking this course?
                      Introduction
                                     What is the course about?
                                     What are the course requirements?


Additional Policies


  See the course webpage for info about:
      Disability Accomodations
      Religious Accomodations
      Classroom Behavior
      Descrimination and Harassment
      Honor Code




                                                                         8 / 30
                   Intelligent Agents
                  Environment Types
                         Agent Types
                           Key Points


Outline
  1   Intelligent Agents
         Agents and Environments
         Example: Vacuum Cleaner World
         Rational Agents
  2   Environment Types
         Specifying the Task
         Describing Environments
         Example Environments
  3   Agent Types
         Reflex Agents
         Goal-based Agents
         Utility-based Agents
         Learning Agents
                                         9 / 30
                   Intelligent Agents
                                        Agents and Environments
                  Environment Types
                                        Example: Vacuum Cleaner World
                         Agent Types
                                        Rational Agents
                           Key Points


Outline
  1   Intelligent Agents
         Agents and Environments
         Example: Vacuum Cleaner World
         Rational Agents
  2   Environment Types
         Specifying the Task
         Describing Environments
         Example Environments
  3   Agent Types
         Reflex Agents
         Goal-based Agents
         Utility-based Agents
         Learning Agents
                                                                        10 / 30
                 Intelligent Agents
                                      Agents and Environments
                Environment Types
                                      Example: Vacuum Cleaner World
                       Agent Types
                                      Rational Agents
                         Key Points


Agents and Environments

                                       sensors

                percepts
                                                          ?
  environment
                                                           agent
                  actions


                     actuators



                                                                      11 / 30
                   Intelligent Agents
                                        Agents and Environments
                  Environment Types
                                        Example: Vacuum Cleaner World
                         Agent Types
                                        Rational Agents
                           Key Points


Vacuum Cleaner World


          A                             B




  Percepts: Location and status, e.g. [A, Dirty]
   Actions: Left, Right, Suck, NoOp

                                                                        12 / 30
               Intelligent Agents
                                    Agents and Environments
              Environment Types
                                    Example: Vacuum Cleaner World
                     Agent Types
                                    Rational Agents
                       Key Points


A Vacuum Cleaner Agent


 class ReflexVacuumAgent(object):
     def take_action(self, percept):
         location, status = percept
         if status == "Dirty":
             return "Suck"
         elif location == "A":
             return "Right"
         elif location == "B":
             return "Left"



                                                                    13 / 30
                   Intelligent Agents
                                        Agents and Environments
                  Environment Types
                                        Example: Vacuum Cleaner World
                         Agent Types
                                        Rational Agents
                           Key Points


Rational Agents

 Performance Measure
 How successful was the agent?
 E.g. the vacuum cleaner agent:
     Maximized clean squares
     Minimized electricity consumed

 Rational Agent
 Selects the action that is expected to maximize the
 performance measure


                                                                        14 / 30
                   Intelligent Agents
                                        Agents and Environments
                  Environment Types
                                        Example: Vacuum Cleaner World
                         Agent Types
                                        Rational Agents
                           Key Points


Rational Agents

 Performance Measure
 How successful was the agent?
 E.g. the vacuum cleaner agent:
     Maximized clean squares
     Minimized electricity consumed

 Rational Agent
 Selects the action that is expected to maximize the
 performance measure


                                                                        14 / 30
                   Intelligent Agents
                                        Agents and Environments
                  Environment Types
                                        Example: Vacuum Cleaner World
                         Agent Types
                                        Rational Agents
                           Key Points


Rational Agents

 Performance Measure
 How successful was the agent?
 E.g. the vacuum cleaner agent:
     Maximized clean squares
     Minimized electricity consumed

 Rational Agent
 Selects the action that is expected to maximize the
 performance measure


                                                                        14 / 30
                   Intelligent Agents
                                        Agents and Environments
                  Environment Types
                                        Example: Vacuum Cleaner World
                         Agent Types
                                        Rational Agents
                           Key Points


Rational vs. Omniscient


 Rational?
     Left turn arrow was red. Didn’t check for oncoming
     traffic. Turned left. Hit by a bus.
     Left turn arrow was green. Didn’t check for oncoming
     traffic. Turned left. Hit by a bus.
     Left turn arrow was green. Checked for oncoming
     traffic, saw none. Turned left. Hit by bus.




                                                                        15 / 30
                   Intelligent Agents
                                        Agents and Environments
                  Environment Types
                                        Example: Vacuum Cleaner World
                         Agent Types
                                        Rational Agents
                           Key Points


Rational vs. Omniscient


 Rational?
     Left turn arrow was red. Didn’t check for oncoming
     traffic. Turned left. Hit by a bus.
     Left turn arrow was green. Didn’t check for oncoming
     traffic. Turned left. Hit by a bus.
     Left turn arrow was green. Checked for oncoming
     traffic, saw none. Turned left. Hit by bus.




                                                                        15 / 30
                   Intelligent Agents
                                        Agents and Environments
                  Environment Types
                                        Example: Vacuum Cleaner World
                         Agent Types
                                        Rational Agents
                           Key Points


Rational vs. Omniscient


 Rational?
     Left turn arrow was red. Didn’t check for oncoming
     traffic. Turned left. Hit by a bus.
     Left turn arrow was green. Didn’t check for oncoming
     traffic. Turned left. Hit by a bus.
     Left turn arrow was green. Checked for oncoming
     traffic, saw none. Turned left. Hit by bus.




                                                                        15 / 30
                   Intelligent Agents
                                        Specifying the Task
                  Environment Types
                                        Describing Environments
                         Agent Types
                                        Example Environments
                           Key Points


Outline
  1   Intelligent Agents
         Agents and Environments
         Example: Vacuum Cleaner World
         Rational Agents
  2   Environment Types
         Specifying the Task
         Describing Environments
         Example Environments
  3   Agent Types
         Reflex Agents
         Goal-based Agents
         Utility-based Agents
         Learning Agents
                                                                  16 / 30
                      Intelligent Agents
                                           Specifying the Task
                     Environment Types
                                           Describing Environments
                            Agent Types
                                           Example Environments
                              Key Points


Specifying a Driving Task

 Performance measure
 safety, destination, profts, legality, comfort. . .

 Environment
 streets/freeways, traffic, pedestrians, weather. . .

 Actuators
 steering, accelerator, brake, speaker/display. . .

 Sensors
 video, accelerometer, microphone, GPS. . .

                                                                     17 / 30
                      Intelligent Agents
                                           Specifying the Task
                     Environment Types
                                           Describing Environments
                            Agent Types
                                           Example Environments
                              Key Points


Specifying a Driving Task

 Performance measure
 safety, destination, profts, legality, comfort. . .

 Environment
 streets/freeways, traffic, pedestrians, weather. . .

 Actuators
 steering, accelerator, brake, speaker/display. . .

 Sensors
 video, accelerometer, microphone, GPS. . .

                                                                     17 / 30
                      Intelligent Agents
                                           Specifying the Task
                     Environment Types
                                           Describing Environments
                            Agent Types
                                           Example Environments
                              Key Points


Specifying a Driving Task

 Performance measure
 safety, destination, profts, legality, comfort. . .

 Environment
 streets/freeways, traffic, pedestrians, weather. . .

 Actuators
 steering, accelerator, brake, speaker/display. . .

 Sensors
 video, accelerometer, microphone, GPS. . .

                                                                     17 / 30
                      Intelligent Agents
                                           Specifying the Task
                     Environment Types
                                           Describing Environments
                            Agent Types
                                           Example Environments
                              Key Points


Specifying a Driving Task

 Performance measure
 safety, destination, profts, legality, comfort. . .

 Environment
 streets/freeways, traffic, pedestrians, weather. . .

 Actuators
 steering, accelerator, brake, speaker/display. . .

 Sensors
 video, accelerometer, microphone, GPS. . .

                                                                     17 / 30
                      Intelligent Agents
                                           Specifying the Task
                     Environment Types
                                           Describing Environments
                            Agent Types
                                           Example Environments
                              Key Points


Specifying a Driving Task

 Performance measure
 safety, destination, profts, legality, comfort. . .

 Environment
 streets/freeways, traffic, pedestrians, weather. . .

 Actuators
 steering, accelerator, brake, speaker/display. . .

 Sensors
 video, accelerometer, microphone, GPS. . .

                                                                     17 / 30
                    Intelligent Agents
                                         Specifying the Task
                   Environment Types
                                         Describing Environments
                          Agent Types
                                         Example Environments
                            Key Points


Describing Environments

 Fully vs. Partially Observable
       Fully All relevant to action is visible, e.g. chess
   Partially Part of environment unavailable, e.g. poker

 Deterministic vs. Strategic vs. Stochastic
    Determ State + action determines next state,
            e.g. crossword
  Strategic State + action + other agent actions
            determines next state, e.g. chess
 Stochastic Next state not fully determined, e.g. poker

                                                                   18 / 30
                    Intelligent Agents
                                         Specifying the Task
                   Environment Types
                                         Describing Environments
                          Agent Types
                                         Example Environments
                            Key Points


Describing Environments
 Episodic vs. Sequential
   Episodic Old actions irrelevant, e.g. face detection
 Sequential Old actions affect current state, e.g. chess

 Static vs. Semidynamic vs. Dynamic
      Static Environment does not change while deciding,
             e.g. chess, poker
       Semi Performance score changes while deciding,
             e.g. face detection
   Dynamic Environment changes while deciding,
             e.g. driving
                                                                   19 / 30
                   Intelligent Agents
                                        Specifying the Task
                  Environment Types
                                        Describing Environments
                         Agent Types
                                        Example Environments
                           Key Points


Describing Environments

 Discrete vs. Continuous
   Discrete States, percepts and actions are countable,
             e.g. chess, poker
 Continuous States, percepts or actions are real-valued,
             e.g. driving

 Single vs. Multiple Agents
    Single Single agent, e.g. crossword, face detection
   Multiple More than one agent, e.g. poker, driving


                                                                  20 / 30
                     Intelligent Agents
                                          Specifying the Task
                    Environment Types
                                          Describing Environments
                           Agent Types
                                          Example Environments
                             Key Points


Example Environments


                                                   Internet
                  Solitaire        Chess          Shopping          Taxi
  Observable        No               Yes              No            No
  Deterministic     No            Strategic         Partly          No
  Episodic          No               No               No            No
  Static            Yes              Yes             Semi           No
  Discrete          Yes              Yes              Yes           No
  Single-agent      Yes              No             Maybe           No




                                                                           21 / 30
                     Intelligent Agents
                                          Specifying the Task
                    Environment Types
                                          Describing Environments
                           Agent Types
                                          Example Environments
                             Key Points


Example Environments


                                                   Internet
                  Solitaire        Chess          Shopping          Taxi
  Observable        No               Yes              No            No
  Deterministic     No            Strategic         Partly          No
  Episodic          No               No               No            No
  Static            Yes              Yes             Semi           No
  Discrete          Yes              Yes              Yes           No
  Single-agent      Yes              No             Maybe           No




                                                                           21 / 30
                     Intelligent Agents
                                          Specifying the Task
                    Environment Types
                                          Describing Environments
                           Agent Types
                                          Example Environments
                             Key Points


Example Environments


                                                   Internet
                  Solitaire        Chess          Shopping          Taxi
  Observable        No               Yes              No            No
  Deterministic     No            Strategic         Partly          No
  Episodic          No               No               No            No
  Static            Yes              Yes             Semi           No
  Discrete          Yes              Yes              Yes           No
  Single-agent      Yes              No             Maybe           No




                                                                           21 / 30
                     Intelligent Agents
                                          Specifying the Task
                    Environment Types
                                          Describing Environments
                           Agent Types
                                          Example Environments
                             Key Points


Example Environments


                                                   Internet
                  Solitaire        Chess          Shopping          Taxi
  Observable        No               Yes              No            No
  Deterministic     No            Strategic         Partly          No
  Episodic          No               No               No            No
  Static            Yes              Yes             Semi           No
  Discrete          Yes              Yes              Yes           No
  Single-agent      Yes              No             Maybe           No




                                                                           21 / 30
                     Intelligent Agents
                                          Specifying the Task
                    Environment Types
                                          Describing Environments
                           Agent Types
                                          Example Environments
                             Key Points


Example Environments


                                                   Internet
                  Solitaire        Chess          Shopping          Taxi
  Observable        No               Yes              No            No
  Deterministic     No            Strategic         Partly          No
  Episodic          No               No               No            No
  Static            Yes              Yes             Semi           No
  Discrete          Yes              Yes              Yes           No
  Single-agent      Yes              No             Maybe           No




                                                                           21 / 30
                     Intelligent Agents
                                          Specifying the Task
                    Environment Types
                                          Describing Environments
                           Agent Types
                                          Example Environments
                             Key Points


Example Environments


                                                   Internet
                  Solitaire        Chess          Shopping          Taxi
  Observable        No               Yes              No            No
  Deterministic     No            Strategic         Partly          No
  Episodic          No               No               No            No
  Static            Yes              Yes             Semi           No
  Discrete          Yes              Yes              Yes           No
  Single-agent      Yes              No             Maybe           No




                                                                           21 / 30
                     Intelligent Agents
                                          Specifying the Task
                    Environment Types
                                          Describing Environments
                           Agent Types
                                          Example Environments
                             Key Points


Example Environments


                                                   Internet
                  Solitaire        Chess          Shopping          Taxi
  Observable        No               Yes              No            No
  Deterministic     No            Strategic         Partly          No
  Episodic          No               No               No            No
  Static            Yes              Yes             Semi           No
  Discrete          Yes              Yes              Yes           No
  Single-agent      Yes              No             Maybe           No




                                                                           21 / 30
                   Intelligent Agents   Reflex Agents
                  Environment Types     Goal-based Agents
                         Agent Types    Utility-based Agents
                           Key Points   Learning Agents


Outline
  1   Intelligent Agents
         Agents and Environments
         Example: Vacuum Cleaner World
         Rational Agents
  2   Environment Types
         Specifying the Task
         Describing Environments
         Example Environments
  3   Agent Types
         Reflex Agents
         Goal-based Agents
         Utility-based Agents
         Learning Agents
                                                               22 / 30
                   Intelligent Agents    Reflex Agents
                  Environment Types      Goal-based Agents
                         Agent Types     Utility-based Agents
                           Key Points    Learning Agents


Simple Reflex Agents


        Agent                             Sensors

                                        What the world
                                        is like now




                                                                Environment
                                        What action I
         Condition−action rules
                                        should do now


                                          Actuators




                                                                              23 / 30
               Intelligent Agents   Reflex Agents
              Environment Types     Goal-based Agents
                     Agent Types    Utility-based Agents
                       Key Points   Learning Agents


Simple Reflex Agent Example


 class ReflexVacuumAgent(object):
     def take_action(self, percept):
         location, status = percept
         if status == "Dirty":
             return "Suck"
         elif location == "A":
             return "Right"
         elif location == "B":
             return "Left"



                                                           24 / 30
                    Intelligent Agents    Reflex Agents
                   Environment Types      Goal-based Agents
                          Agent Types     Utility-based Agents
                            Key Points    Learning Agents


Stateful Reflex Agents


                                           Sensors
                  State
                                         What the world
          How the world evolves          is like now




                                                                 Environment
           What my actions do




                                         What action I
          Condition−action rules
                                         should do now


        Agent                              Actuators




                                                                               25 / 30
                 Intelligent Agents   Reflex Agents
                Environment Types     Goal-based Agents
                       Agent Types    Utility-based Agents
                         Key Points   Learning Agents


Stateful Reflex Agent Example

 class StatefulReflexVacuumAgent(object):
     def __init__(self):
         self.time_at_location = 3
         self.directions = dict(A="Right", B="Left")
     def take_action(self, percept):
         self.time_at_location += 1
         location, status = percept
         if status == "Dirty":
             return "Suck"
         elif self.time_at_location > 3:
             self.time_at_location = 0
             return self.directions[location]
         else:
             return "NoOp"

                                                             26 / 30
                   Intelligent Agents      Reflex Agents
                  Environment Types        Goal-based Agents
                         Agent Types       Utility-based Agents
                           Key Points      Learning Agents


Goal-based Agents


                                            Sensors
                 State
                                         What the world
         How the world evolves           is like now




                                                                  Environment
                                        What it will be like
          What my actions do
                                         if I do action A




                                         What action I
                 Goals
                                         should do now


        Agent                               Actuators




                                                                                27 / 30
                    Intelligent Agents      Reflex Agents
                   Environment Types        Goal-based Agents
                          Agent Types       Utility-based Agents
                            Key Points      Learning Agents


Utility-based Agents


                                             Sensors
                  State
                                          What the world
          How the world evolves           is like now




                                                                   Environment
                                         What it will be like
           What my actions do
                                          if I do action A

                                         How happy I will be
                  Utility                 in such a state

                                           What action I
                                           should do now


         Agent                               Actuators




                                                                                 28 / 30
                      Intelligent Agents    Reflex Agents
                     Environment Types      Goal-based Agents
                            Agent Types     Utility-based Agents
                              Key Points    Learning Agents


Learning Agents

         Performance standard


                  Critic                    Sensors


         feedback




                                                                   Environment
                              changes
                Learning                   Performance
                element                     element
                             knowledge
          learning
            goals

                Problem
                generator

        Agent                               Actuators




                                                                                 29 / 30
                  Intelligent Agents
                 Environment Types
                        Agent Types
                          Key Points


Key Points


    Agents take actions based on percepts
    Rational agents maximize a performance measure
    Features of task environments:
        Observable? Deterministic? Episodic?
        Static? Discrete? Single-agent?
    Agent architectures:
        Reflex, Stateful reflex, Goal-based, Utility-based




                                                           30 / 30
                  Intelligent Agents
                 Environment Types
                        Agent Types
                          Key Points


Key Points


    Agents take actions based on percepts
    Rational agents maximize a performance measure
    Features of task environments:
        Observable? Deterministic? Episodic?
        Static? Discrete? Single-agent?
    Agent architectures:
        Reflex, Stateful reflex, Goal-based, Utility-based




                                                           30 / 30
                  Intelligent Agents
                 Environment Types
                        Agent Types
                          Key Points


Key Points


    Agents take actions based on percepts
    Rational agents maximize a performance measure
    Features of task environments:
        Observable? Deterministic? Episodic?
        Static? Discrete? Single-agent?
    Agent architectures:
        Reflex, Stateful reflex, Goal-based, Utility-based




                                                           30 / 30
                  Intelligent Agents
                 Environment Types
                        Agent Types
                          Key Points


Key Points


    Agents take actions based on percepts
    Rational agents maximize a performance measure
    Features of task environments:
        Observable? Deterministic? Episodic?
        Static? Discrete? Single-agent?
    Agent architectures:
        Reflex, Stateful reflex, Goal-based, Utility-based




                                                           30 / 30
                  Intelligent Agents
                 Environment Types
                        Agent Types
                          Key Points


Key Points


    Agents take actions based on percepts
    Rational agents maximize a performance measure
    Features of task environments:
        Observable? Deterministic? Episodic?
        Static? Discrete? Single-agent?
    Agent architectures:
        Reflex, Stateful reflex, Goal-based, Utility-based




                                                           30 / 30

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:5
posted:10/23/2012
language:English
pages:54