29
Lecture 2: Intelligent Agents Heshaam Faili [email protected]. ir University of Tehran What is an intelligent agent? Structure of intelligent agents Environments Examples

Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

Embed Size (px)

DESCRIPTION

3 Concepts Environment Sensor Actuator( effectors ) Agent Functions Agent Program Percept and Percept Sequence Rational Agent Performance measure

Citation preview

Page 1: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

Lecture 2: Intelligent Agents

Heshaam [email protected]

University of Tehran

What is an intelligent agent?

Structure of intelligent agents

EnvironmentsExamples

Page 2: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

2

Intelligent agents: their environment and actions

Page 3: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

3

Concepts Environment Sensor Actuator( effectors ) Agent Functions Agent Program Percept and Percept Sequence Rational Agent Performance measure

Page 4: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

4

Ideal rational agents For each possible percept sequence, an ideal

rational agent should take the action that is expected to maximize its performance measure, based on evidence from the percept sequence and its built-in knowledge.

Key concept: mapping from perceptions to actions

Different architectures to realize the mapping

Page 5: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

5

Structure of intelligent agents

Agent program: a program that implements the mapping from percepts to actions: The JOB of AI

Architecture: the platform to run the program (note: not necessarily the hardware!)

Agent = architecture + program Examples:

medical diagnosis- part-picking robot satellite image analysis - interactive tutor refinery controller - flight simulator

Page 6: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

6

An Example(Vacuum Cleaner)

What is good Performance measure?

amount of dirt cleaned up in a single eight-hour shift ??

…Clean and dump it again, …

reward the agent for having a clean floor.

For example, one point could be awarded for each clean square at

each time step

As a general rule, it is better to design performance

measures according to what one actually wants in the environment, rather than

according to how one thinks the agent should behave.

Page 7: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

7

Task Environment PEAS: Performance, Environment,

Actuator, Sensors

Page 8: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

8

More Examples

Page 9: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

9

Properties of environments

Fully Observable or Partially Observable: is the state of the world fully know at each step?

Deterministic to Stochastic: how much is the next state determined by the current state? If the environment is deterministic except for

the actions of other agents, we say that the environment is strategic.

Episodic to sequential: how much state memory?

Page 10: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

10

Properties of environments

Static to dynamic: how much independent change? SemiDynamic: If the environment itself does

not change with the passage of time but the agent's performance score does

Discrete to continuous: how clearly are the actions and percepts differentiated?

Single Agent or multi Agent: Competitive or Co-operative

Page 11: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

11

Examples of environments

Page 12: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

12

Rational or OmniScience An omniscient agent knows the actual

outcome of its actions and can act accordingly; but omniscience is impossible in reality.

Rationality is not the same as perfection Rationality maximizes expected

performance, while perfection maximizes actual performance.

Page 13: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

13

Table-Driven Agentsfunction Table-driven-agent(percept) returns action

static: percepts, a sequence, initially empty

table, indexed by percept sequences (given)

append percept to the end of percepts

action := LOOKUP(percepts, table)

return action

• Keeps a list of all percepts seen so far• Table too large• takes too long to build• might not be available

TAXI DRIVER: need table with 10 250,000,000,000 entries for 1 hour driving

(30frames per second 640*480 * 24 color)CHESS: 10 150

Page 14: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

14

Simple Reflex Agent (1)e.g.

if car-in-front-is-braking then initiate-braking.

Page 15: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

15

Simple Reflex Agent (2)function Simple-Reflex-Agent(percept) returns action

static: rules, a set of condition-action rules

state := Interpret-Input (percept)

rule := Rule-Match(state, rule)

action := Rule-Action[rule]

return action

• No memory, no planning

Page 16: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

16

Simple Reflex example

Page 17: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

17

Partially Observable Simple Reflex Vacuum cleaner with only one

sensor: Only get Status (Dirty/Clean) Infinite loops unavoidable in partially

observable Randomized Simple Reflex

Page 18: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

18

Model-based Reflex Agents The most effective way to handle

partial observability is to keep track of the part of the world it can't see now.

Store some of internal nodes Change internal nodes based on

Environments and Agent Actions Model the Environment by some nodes

Page 19: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

19

Model-based Reflex Agents

Page 20: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

20

Model-based Reflex Agents

function Reflex-Agent-State(percept) returns action

static: rules, a set of condition-action rules

state, a description of the current state

state := Update-State (state, percept)

rule := Rule-Match(state, rules)

action := Rule-Action[rule]

state := Update-State (state, action)

return action• still no longer-term planning

Page 21: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

21

Goal-based Agents Knowing the current state is not

always enough to decide what to do. For example, the taxi can turn left,

turn right, or go straight on. The correct decision depends on where the taxi is trying to get to.

GOAL-BASED

Page 22: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

22

Goal-based Agents (1)

Page 23: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

23

Goal-based Agents (2)function Goal-Based-Agent(percept, goal) returns action

static: rules, a set of condition-action rules

state, a description of the current state

state := Update-State (state, percept)

rule := Plan-Best-Move(state, rules, goal)

action := Rule-Action[rule]

state := Update-State (state, action)

return action

• longer term planning, but what about cost?

Page 24: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

24

Utility-based Agents (1) Goals alone are not enough to generate high-

quality behavior There are many action sequences that will get the

taxi to its destination Add utility evaluation: not only how close

does the action take me to the goal, but also how useful it is for the agent

Other aspects to be considered: uncertainty in perceptions and actions incomplete knowledge environment characteristics

Page 25: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

25

Utility-based Agents (2)

Page 26: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

26

Learning Agent How the agent programs come into being? Turing (1950) considers the idea of

actually programming his intelligent machines by hand.

But he also proposed to build learning machines and then to teach them (Learning).

Learning allows the agent to operate in initially unknown environments and to become better and better…

Page 27: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

27

Learning Agent - Learning element: responsible for making

improvements-Performance elements: responsible for

selecting external actions- critic : learning elements uses feedback

from Critic-Problem generator: It is responsible for

suggesting actions that will lead to new and informative experiences.

Page 28: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

28

Learning Agent The learning element can make

changes to any of the "knowledge" components shown in the agent diagrams learning directly from the percept sequence. Observation of pairs of successive states

("How the world evolves“) observation of the results of its

actions ("What my actions do.“)

Page 29: Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments

29

?