Скачать презентацию 74 419 Artificial Intelligence Intelligent Agents 1 Russell Скачать презентацию 74 419 Artificial Intelligence Intelligent Agents 1 Russell

c7c523e3395b09f3e2c9d328aba2407e.ppt

  • Количество слайдов: 56

74. 419 Artificial Intelligence Intelligent Agents 1 Russell and Norvig, Ch. 2 74. 419 Artificial Intelligence Intelligent Agents 1 Russell and Norvig, Ch. 2

Outline Ø Ø Ø Agents and environments Rationality PEAS (Performance measure, Environment, Actuators, Sensors) Outline Ø Ø Ø Agents and environments Rationality PEAS (Performance measure, Environment, Actuators, Sensors) Environment types Agent types

Agents An agent is anything that can be viewed as perceiving its environment through Agents An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that environment through actuators. Human agent has, for example: n eyes, ears, and other organs as sensors; n hands, legs, mouth, and other body parts as actuators. Robotic agent has, for example: n cameras and infrared range finders as sensors; n various motors as actuators.

Agent and Environment Agent and Environment

The Vacuum-Cleaner Mini-World n n n Environment: square A and B Percepts: location and The Vacuum-Cleaner Mini-World n n n Environment: square A and B Percepts: location and status, e. g. , [A, Dirty] Actions: left, right, suck, and no-op

The Vacuum-Cleaner Mini-World State Action [A, Clean] Right [A, Dirty] Suck [B, Clean] Left The Vacuum-Cleaner Mini-World State Action [A, Clean] Right [A, Dirty] Suck [B, Clean] Left [B, Dirty] Suck [A, Dirty], [A, Clean] Right [A, Clean], [B, Dirty] [A, Clean], [B, Clean]. . . Suck No-op. . .

Agent Function § The agent function maps from percept histories to actions: [f: P* Agent Function § The agent function maps from percept histories to actions: [f: P* A] n § § An agent is completely specified by the agent function mapping percept sequences to actions The agent program runs on the physical architecture to produce f. agent = architecture + program

The Vacuum-Cleaner Mini-World function REFLEX-VACUUM-AGENT ([location, status]) return an action if status == Dirty The Vacuum-Cleaner Mini-World function REFLEX-VACUUM-AGENT ([location, status]) return an action if status == Dirty then return Suck else if location == A then return Right else if location == B then return Left Does not work this way. Need full state space (table) or memory.

The Vacuum-Cleaner Mini-World State Action [A, Clean] [A, Dirty] [B, Clean] [B, Dirty] [A, The Vacuum-Cleaner Mini-World State Action [A, Clean] [A, Dirty] [B, Clean] [B, Dirty] [A, Dirty], [A, Clean], [B, Dirty], [B, Clean], [A, Dirty] [A, Clean], [B, Clean], [A, Clean] Right Suck Left Suck No-op

Rational Agents n Rational Agent: For each possible percept sequence, a rational agent should Rational Agents n Rational Agent: For each possible percept sequence, a rational agent should select an action that is expected to maximize its performance measure, given the evidence provided by the percept sequence and whatever built-in knowledge the agent has.

Rationality n Rationality omniscience n n Rationality perfection n n An omniscient agent knows Rationality n Rationality omniscience n n Rationality perfection n n An omniscient agent knows the actual outcome of its actions. Rationality maximizes expected performance, while perfection maximizes actual performance. "Ideal Rational Agent": Always does "the right thing".

Rationality n The proposed definition requires: n Information gathering/exploration n n Learn from percepts Rationality n The proposed definition requires: n Information gathering/exploration n n Learn from percepts n n To maximize future rewards Extending prior knowledge Agent autonomy n Compensate for incorrect prior knowledge

Rationality n What is rational at a given time depends on: n n Performance Rationality n What is rational at a given time depends on: n n Performance measure, Prior environment knowledge, Actions, Percept sequence to date (sensors).

Task Environment To design a rational agent we must first specify its task environment. Task Environment To design a rational agent we must first specify its task environment. n PEAS description of the task environment: n n n Performance Environment Actuators Sensors

Task Environment - Example For example, a fully automated taxi driver: n PEAS description Task Environment - Example For example, a fully automated taxi driver: n PEAS description of the environment: n Performance § Safety, destination, profits, legality, comfort n Environment § Streets/freeways, other traffic, pedestrians, weather, , … n Actuators § Steering, accelerating, brake, horn, speaker/display, … n Sensors § Video, sonar, speedometer, engine sensors, keyboard, GPS, …

Examples of Agents (Norvig) Examples of Agents (Norvig)

PEAS Agent: Medical diagnosis system n Performance measure: Healthy patient, minimize costs, lawsuits n PEAS Agent: Medical diagnosis system n Performance measure: Healthy patient, minimize costs, lawsuits n Environment: Patient, hospital, staff n Actuators: Screen display (questions, tests, diagnoses, treatments, referrals) n Sensors: Keyboard (entry of symptoms, findings, patient's answers)

PEAS Agent: Part-picking robot n Performance measure: Percentage of parts in correct bins n PEAS Agent: Part-picking robot n Performance measure: Percentage of parts in correct bins n Environment: Conveyor belt with parts, bins n Actuators: Jointed arm and hand n Sensors: Camera, joint angle sensors

PEAS Agent: Interactive English Tutor n Performance measure: Maximize student's score on test n PEAS Agent: Interactive English Tutor n Performance measure: Maximize student's score on test n Environment: Set of students n Actuators: Screen display (exercises, suggestions, corrections) n Sensors: Keyboard

Classification of Environment Types Fully observable (vs. partially observable): An agent's sensors give it Classification of Environment Types Fully observable (vs. partially observable): An agent's sensors give it access to the complete state of the environment at each point in time. Ø Deterministic (vs. stochastic): The next state of the environment is completely determined by the current state and the action executed by the agent. (If the environment is deterministic, except for the actions of other agents, then the environment is strategic) Ø Episodic (vs. sequential): The agent's experience is divided into atomic "episodes" (each episode consists of the agent perceiving and then performing a single action), and the choice of action in each episode depends only on the episode itself. Ø

Environment types Static (vs. dynamic): The environment is unchanged while an agent is deliberating. Environment types Static (vs. dynamic): The environment is unchanged while an agent is deliberating. (The environment is semidynamic if the environment itself does not change with the passage of time but the agent's performance score does). Ø Discrete (vs. continuous): A limited number of distinct, clearly defined percepts and actions. Ø Single agent (vs. multiagent): An agent operating by itself in an environment. Ø

Task Environments (Norvig) Agents design depends on task environment: § deterministic vs. stochastic vs. Task Environments (Norvig) Agents design depends on task environment: § deterministic vs. stochastic vs. non-deterministic § assembly line vs. weather vs. “odds & gods” § episodic vs. non-episodic § assembly line vs. diagnostic repair robot, Flakey § static vs. dynamic § room without vs. with other agents § discrete vs. continuous § chess game vs. autonomous vehicle § single vs. multi agent § solitaire game vs. soccer, taxi driver § fully observable vs. partially observable § video camera vs. infrared camera - colour?

Infrared Picture of an Unpleasant Situation from www. indigosystems. com Infrared Picture of an Unpleasant Situation from www. indigosystems. com

Environment types Solitaire Observable? ? Deterministic? ? Episodic? ? Static? ? Discrete? ? Single-agent? Environment types Solitaire Observable? ? Deterministic? ? Episodic? ? Static? ? Discrete? ? Single-agent? ? Backgammon Internet shopping Taxi

Environment types Fully vs. partially observable: an environment is fully observable when the sensors Environment types Fully vs. partially observable: an environment is fully observable when the sensors can detect all aspects that are relevant to the choice of action. Solitaire Observable? ? Deterministic? ? Episodic? ? Static? ? Discrete? ? Single-agent? ? Backgammon Internet shopping Taxi

Environment types Fully vs. partially observable: an environment is fully observable when the sensors Environment types Fully vs. partially observable: an environment is fully observable when the sensors can detect all aspects that are relevant to the choice of action. Solitaire Observable? ? Deterministic? ? Episodic? ? Static? ? Discrete? ? Single-agent? ? Backgammon Internet shopping Taxi FULL PARTIAL

Environment types Deterministic vs. stochastic: if the next environment state is completely determined by Environment types Deterministic vs. stochastic: if the next environment state is completely determined by the current state and the executed action, then the environment is deterministic. Solitaire Observable? ? Deterministic? ? Episodic? ? Static? ? Discrete? ? Single-agent? ? Backgammon Internet shopping Taxi FULL PARTIAL

Environment types Deterministic vs. stochastic: if the next environment state is completely determined by Environment types Deterministic vs. stochastic: if the next environment state is completely determined by the current state and the executed action, then the environment is deterministic. Solitaire Backgammon Internet shopping Taxi Observable? ? FULL PARTIAL Deterministic? ? YES NO Episodic? ? Static? ? Discrete? ? Single-agent? ?

Environment types Episodic vs. sequential: In an episodic environment, the agent’s experience can be Environment types Episodic vs. sequential: In an episodic environment, the agent’s experience can be divided into atomic steps, where the agent perceives and then performs a single action. The choice of action depends only on the episode itself. Solitaire Backgammon Internet shopping Taxi Observable? ? FULL PARTIAL Deterministic? ? YES NO Episodic? ? Static? ? Discrete? ? Single-agent? ?

Environment types Episodic vs. sequential: In an episodic environment, the agent’s experience can be Environment types Episodic vs. sequential: In an episodic environment, the agent’s experience can be divided into atomic steps, where the agent perceives and then performs a single action. The choice of action depends only on the episode itself. Solitaire Backgammon Internet shopping Taxi Observable? ? FULL PARTIAL Deterministic? ? YES NO Episodic? ? NO NO Static? ? Discrete? ? Single-agent? ?

Environment types Static vs. dynamic: If the environment can change, while the agent is Environment types Static vs. dynamic: If the environment can change, while the agent is choosing an action, the environment is dynamic. It is semi-dynamic, if the agent’s performance changes, even when the environment remains the same. Solitaire Backgammon Internet shopping Taxi Observable? ? FULL PARTIAL Deterministic? ? YES NO Episodic? ? NO NO Static? ? Discrete? ? Single-agent? ?

Environment types Static vs. dynamic: If the environment can change, while the agent is Environment types Static vs. dynamic: If the environment can change, while the agent is choosing an action, the environment is dynamic. It is semi-dynamic, if the agent’s performance changes, even when the environment remains the same. Solitaire Backgammon Internet shopping Taxi Observable? ? FULL PARTIAL Deterministic? ? YES NO Episodic? ? NO NO Static? ? YES SEMI NO Discrete? ? Single-agent? ?

Environment types Discrete vs. continuous: This distinction can be applied to the state of Environment types Discrete vs. continuous: This distinction can be applied to the state of the environment, the way time is handled and to the percepts/ actions of the agent. Solitaire Backgammon Internet shopping Taxi Observable? ? FULL PARTIAL Deterministic? ? YES NO Episodic? ? NO NO Static? ? YES SEMI NO Discrete? ? Single-agent? ?

Environment types Discrete vs. continuous: This distinction can be applied to the state of Environment types Discrete vs. continuous: This distinction can be applied to the state of the environment, the way time is handled and to the percepts/ actions of the agent. Solitaire Backgammon Internet shopping Taxi Observable? ? FULL PARTIAL Deterministic? ? YES NO Episodic? ? NO NO Static? ? YES SEMI NO Discrete? ? YES YES NO Single-agent? ?

Environment types Single vs. multi-agent: Does the environment contain other agents who are also Environment types Single vs. multi-agent: Does the environment contain other agents who are also maximizing some performance measure that depends on the current agent’s actions? Solitaire Backgammon Internet shopping Taxi Observable? ? FULL PARTIAL Deterministic? ? YES NO Episodic? ? NO NO Static? ? YES SEMI NO Discrete? ? YES YES NO Single-agent? ?

Environment types Single vs. multi-agent: Does the environment contain other agents, who are also Environment types Single vs. multi-agent: Does the environment contain other agents, who are also maximizing some performance measure that depends on the current agent’s actions? Solitaire Backgammon Internet shopping Taxi Observable? ? FULL PARTIAL Deterministic? ? YES NO Episodic? ? NO NO Static? ? YES SEMI NO Discrete? ? YES YES NO Single-agent? ? YES NO NO NO

Examples of Environment Types Chess with clock Fully observable Deterministic Episodic Static Discrete Single Examples of Environment Types Chess with clock Fully observable Deterministic Episodic Static Discrete Single agent Chess w. o. clock Taxi driving Yes Strategic No Semi Yes No Yes Strategic No Yes No No The real world is (of course) partially observable, stochastic, sequential, dynamic, continuous, multi-agent.

Environment types n The simplest environment is n n Fully observable, deterministic, episodic, static, Environment types n The simplest environment is n n Fully observable, deterministic, episodic, static, discrete and single-agent. Most real situations are: n Partially observable, stochastic, sequential, dynamic, continuous and multi-agent.

Agent types n How does the inside of the agent work? n n All Agent types n How does the inside of the agent work? n n All agents have the same skeleton: n n Agent = architecture + program Input = current percepts Output = action Program= manipulates input to produce output Note difference with agent function.

Agent types Function TABLE-DRIVEN_AGENT(percept) returns an action static: percepts, a sequence initially empty table, Agent types Function TABLE-DRIVEN_AGENT(percept) returns an action static: percepts, a sequence initially empty table, a table of actions, indexed by percept sequence append percept to the end of percepts action LOOKUP(percepts, table) return action This approach is doomed to failure.

Agent types n Four basic kinds of agent programs will be discussed: n n Agent types n Four basic kinds of agent programs will be discussed: n n n Simple reflex agents Model-based reflex agents Goal-based agents Utility-based agents All these can be turned into learning agents.

Simple Reflex Agents n Select action on the basis of only the current percept. Simple Reflex Agents n Select action on the basis of only the current percept. n n n E. g. the vacuum-agent Large reduction in possible percept/action situations (next page). Implemented through condition-action rules n If dirty then suck

Simple Reflex Agent – Example (Nilsson) Robot in Maze • perceives 8 squares around Simple Reflex Agent – Example (Nilsson) Robot in Maze • perceives 8 squares around it • low-level percept: can robot move to square or not • higher level percept: 2 unit segments • 4 basic actions: left (west), right (east), up (north), down (south) • task is to move along a border • no 'tight' spaces, at least two free squares

Simple Reflex Agent - Example (Nilsson) Note: The description of the left bottom agent Simple Reflex Agent - Example (Nilsson) Note: The description of the left bottom agent seems to be wrong. This agent will walk clockwise along the outside wall. Note: The description of the left bottom agent seems to belong to this agent. It will walk counter- clockwise around the object.

Simple Reflex Agent - Example Behaviour Routines If x 1=1 and x 2=0 then Simple Reflex Agent - Example Behaviour Routines If x 1=1 and x 2=0 then move right If x 2=1 and x 3=0 then move down If x 3=1 and x 4=0 then move left If x 4=1 and x 1=0 then move up else move up

Simple Reflex Agent - Example Simple Reflex Agent - Example

Simple Reflex Agents function SIMPLE-REFLEX-AGENT(percept) returns an action static: rules, a set of condition-action Simple Reflex Agents function SIMPLE-REFLEX-AGENT(percept) returns an action static: rules, a set of condition-action rules state INTERPRET-INPUT(percept) rule RULE-MATCH(state, rules) action RULE-ACTION[rule] return action Will only work if the environment is fully observable. Otherwise infinite loops may occur.

The Vacuum-Cleaner Mini-World function REFLEX-VACUUM-AGENT ([location, status]) return an action if status == Dirty The Vacuum-Cleaner Mini-World function REFLEX-VACUUM-AGENT ([location, status]) return an action if status == Dirty then return Suck else if location == A then return Right else if location == B then return Left Does not work this way. Need full state space (table) or memory.

Model/State-based Agents n To tackle partially observable environments. n n Maintain internal state Over Model/State-based Agents n To tackle partially observable environments. n n Maintain internal state Over time update state using world knowledge How does the world change. n How do actions affect world. Model of World n

Model/State-based Agents function REFLEX-AGENT-WITH-STATE(percept) returns an action static: rules, a set of condition-action rules Model/State-based Agents function REFLEX-AGENT-WITH-STATE(percept) returns an action static: rules, a set of condition-action rules state, a description of the current world state (action, the most recent action) state UPDATE-STATE(state, (action, ) percept) rule RULE-MATCH(state, rule) action RULE-ACTION[rule] return action

Goal-based Agents n The agent needs a goal to know which situations are desirable. Goal-based Agents n The agent needs a goal to know which situations are desirable. n Things become difficult when long sequences of actions are required to reach the goal. Typically investigated in search and planning research. n Major difference: future is taken into account. n Is more flexible since knowledge is represented explicitly - to a certain degree and can be manipulated. n

Utility-based Agents n Certain goals can be reached in different ways. n n n Utility-based Agents n Certain goals can be reached in different ways. n n n Some are better, have a higher utility. Utility function maps a (sequence of) state(s) onto a real number. Improvement on goal setting: n n Selecting between conflicting goals. Select appropriately between several goals based on likelihood of success.

Learning Agents n All previous agentprograms describe methods for selecting actions. n n n Learning Agents n All previous agentprograms describe methods for selecting actions. n n n Yet, this does not explain the origin or development of these programs. Learning mechanisms can be used. Advantage is the robustness of the program towards unknown environments.

Learning Agents n Learning element: introduce improvements in performance element. n n Performance element: Learning Agents n Learning element: introduce improvements in performance element. n n Performance element: selecting actions based on percepts. n n Critic provides feedback on agents performance based on fixed performance standards. Corresponds to the previous agent programs. Problem generator: suggests actions that will lead to new and informative experiences. n Exploration vs. exploitation

Robotic Sensors (digital) camera n infrared sensor n range finders, e. g. radar, sonar Robotic Sensors (digital) camera n infrared sensor n range finders, e. g. radar, sonar n GPS n tactile (whiskers, bump panels) n proprioceptive sensors, e. g. shaft decoders n force sensors n torque sensors n

Robotic Effectors ‘limbs’ connected through joints; n degrees of freedom = #directions in which Robotic Effectors ‘limbs’ connected through joints; n degrees of freedom = #directions in which limb can move (incl. rotation axis) n drives: wheels (land), propellers, turbines (air, water) n driven through electric motors, pneumatic (gas), or hydraulic (fluids) actuation n statically stable, dynamically stable n