Intelligent Agents Chapter 2 B. Ombuki-Berman, B. Ross, with - - PowerPoint PPT Presentation

intelligent agents
SMART_READER_LITE
LIVE PREVIEW

Intelligent Agents Chapter 2 B. Ombuki-Berman, B. Ross, with - - PowerPoint PPT Presentation

Intelligent Agents Chapter 2 B. Ombuki-Berman, B. Ross, with material from Artificial Intelligence: A Modern Approach (butchered by Earl) Agents An agent is anything that can be viewed as perceiving its environment through sensors and


slide-1
SLIDE 1

Intelligent Agents

Chapter 2

  • B. Ombuki-Berman, B. Ross, with material from

Artificial Intelligence: A Modern Approach (butchered by Earl)

slide-2
SLIDE 2

Agents

  • An agent is anything that can be viewed as perceiving its

environment through sensors and acting upon that environment through actuators

  • Percept: perceptual input (e.g. Text, image, sound, ...)
  • Action: output acting on environment (e.g. Spinning a motor,

picking up an object, turning on a light)

  • Agent function: Maps a percept sequence to an action
  • Agent Program: A concrete implementation running in a system
slide-3
SLIDE 3

Agents

  • More generally, a rational agent, for a possible percept sequence,

selects an action that maximizes some performance measure, given evidence provided by the sequence, and built-in knowledge in the agent

  • i.e. It “does the right thing for the situation”
  • Performance measure: criterion for success
  • Generally measured based on states of (i.e. changes to) the

environment

  • Good vs bad? Better vs worse

– Clear criterion vs less well-defined

  • Generally chosen by the designer, and task-specific
  • Rationality: reasonably correct
  • Not perfection!
slide-4
SLIDE 4

Rationality

  • Rationality depends on:
  • The performance measure that defines the criterion

for success

  • The agent's prior knowledge of the environment
  • The actions the agent can perform
  • The agent's percept sequence (to date)
  • This takes us back to our definition for a

rational agent

slide-5
SLIDE 5

So... what's a percept sequence?

  • A percept is the agent's perceptual inputs at any given
  • time. A percept sequence is the complete history of

everything the agent has ever perceived

  • Silly examples of the difference:
  • If your butlertron offers you a drink, and you decline it, it'd be

nice if he didn't immediately offer you another drink

  • If your robotic vacuum automaton is on the prowl for dirt, it

should probably remember that it's already checked one room, and move on to another

  • Remember: an agent function might act on a potentially

infinite percept sequence, so you may be required to impose some form of limitation or generalization

slide-6
SLIDE 6

Example Time!

Percept Sequence Action [A, Clean] Right [A, Dirty] Suck [B, Clean] Left [B, Dirty] Suck [A, Clean], [A, Clean] Right [A, Clean], [A, Dirty] Suck ... ... [A, Clean], [A, Clean], [A,Clean] Right [A, Clean], [A, Clean], [A, Dirty] Suck ... ... A B

  • Note that it could be cleaning until the end of time, with a virtually limitless percept
  • history. However, the same task can be accomplished just as well by not

acknowledging past states in this case

slide-7
SLIDE 7

Is This a Rational Agent?

  • Performance Measure?
  • What are we actually examining the state of?
  • Prior Knowledge?
  • What do we know in advance?
  • Actions?
  • What can we do?
  • Percept Sequences?
  • Evidence of perception?
slide-8
SLIDE 8

Is This a Rational Agent?

  • Performance Measure?
  • Perhaps we could count up the number of clean

squares after some length of time?

– e.g. after 500 timesteps

  • Note that we're looking at the environment
  • Prior Knowledge?
  • Actions?
  • Percept Sequences?
slide-9
SLIDE 9

Is This a Rational Agent?

  • Performance Measure?
  • Prior Knowledge?
  • Presumably we know how many rooms there are, and which

are accessible from which

  • We can assume squares are still clean during operation

after we've cleaned them

  • There's no reason to assume we have clairvoyant

knowledge of all dirt in advance

  • We may or may not know our initial position within the map
  • Actions?
  • Percept Sequences?
slide-10
SLIDE 10

Is This a Rational Agent?

  • Performance Measure?
  • Prior Knowledge?
  • Actions?
  • Left, Right, and Suck
  • Moving left or right should not be able to result in

leaving the map

  • Percept Sequences?
slide-11
SLIDE 11

Is This a Rational Agent?

  • Performance Measure?
  • Prior Knowledge?
  • Actions?
  • Perception?
  • Our table of Percept Sequences presupposes the

ability to perceive dirt, and to observe location within the map

– Is the latter practical? Why or why not?

slide-12
SLIDE 12

Percept Sequences

  • You probably noticed some other issues with

that style of system (other than the potential for Percept Sequences of infinite length)

  • Comments? Ideas?
slide-13
SLIDE 13

Caveat to Rational Agents

  • Note that this view of agents is just to make analyzing

systems easier

  • If something else works: use it
  • Similarly, the ability to incorporate Percept Sequences

doesn't necessarily make rational agents an appropriate perspective for a problem

  • e.g. A calculator can be modeled as an agent

– 2,+,2,= could be presented as a Percept

Sequence, but that doesn't make it a good idea!

slide-14
SLIDE 14

Final Thought: Rationality != Perfection

  • A rational agent should maximize expected

performance, based on the acquired knowledge (percepts) to date

  • A vacuum-bot not checking for dirt before applying

suction? Irrational

  • A vacuum-bot not checking for gremlins? Rational

– Even if the bot then fails because it's destroyed by

gremlins

slide-15
SLIDE 15

Learning

  • Ideally, we'd like an agent to be able to learn
  • In this context, learning means retaining relevant information from perception
  • Simplest example: it'd be nice if a robot could 'discover' the existence of a new room in

the map if encountered in the field

  • Already seen: the vacuum-bot doesn't know which rooms are clean, but perceives these

(and then maintains knowledge of perpetual cleanliness post-suckitude)

  • In a good system, we can start with prior knowledge, and then amend it as

necessary

  • e.g. knowing the floorplan of Brock, but then deciding a hallway is off-limits if it has too

many tables set up (/too crowded) to repeatedly navigate quickly

  • In a very good system, we might even be able to learn trends and adapt

accordingly

  • e.g. the main hallways at Brock tend to get dirty faster, so the cleaning staff already

knows to give them extra attention

slide-16
SLIDE 16

Autonomy

  • The less an agent relies on prior knowledge,

the more autonomous it is

  • This isn't just important because of flexibility...

– It's possible (even easy) to predispose an agent/robot to

certain behaviours through overinforming it in advance

– Similarly, it's often more suitable for path-finding systems

to know only the objective facts (locations, connections, etc.), and be free of additional biases from the designer

  • (If you'd like a counterexample, ask me about Sudoku)
  • For a good example, consider our hallway example

from the previous slide

slide-17
SLIDE 17

Remember to eat your PEAS!

  • Let's look at some of the important aspects of rational agents...
  • Performance, Environment, Actuators, and Sensors define a task

environment

  • Let's go straight to an example!

Agent Type Performance Measure Environment Actuators Sensors Taxi driver Safe, fast, legal, comfortable trip, maximize profits (, actually gets there? what else?) Roads, other traffic, pedestrians, customers Steering, accelerator, brake, signal, horn, display Cameras, sonar, speedometer, GPS, odometer, accelerometer, engine sensors, keyboard

slide-18
SLIDE 18

Agent Type Performance Measure Environment Actuators Sensors

Medical diagnosis sytem

Healthy patient, reduced costs Patient, hospital, staff? Display (questions, tests, diagnoses, treatments, referrals) Keyboard (entry of symptoms, findings, patient answers and history) Part-picking robot %age of parts in correct bins Conveyor belt with parts; bins Jointed arm, manipulator (hand) Camera, encoders, possibly more? Interactive math tutor Student's score (or change in score) Students, possibly agency Display (exercises, corrections) Keyboard Web-scraper? FPS bot? ? ? ? ?

  • Note that some of these are entirely software-

based agents (softbots)

slide-19
SLIDE 19

Environment Types

  • Fully observable vs Partially observable
  • Fully: everything seen; shows all relevant information
  • Partially: noise, inaccurate sensors, hidden info, ...
  • Basically, will the agent be considered omniscient?
  • Deterministic vs Stochastic
  • Deterministic: the next state depends solely on current state and next action
  • Stochastic: probabilistic; other factors involved (complex?)
  • Basically, will the environment always behave predictably?
  • Episodic vs Sequential
  • Episodic: one self-contained, independent situation at a time (atomic)
  • Sequential: current decision affects future ones (you need to 'think ahead')

– e.g. chess, automated vehicles, floor-painting, etc.

  • Typically, episodic's a lot simpler to deal with
slide-20
SLIDE 20

Environment Types

  • Static vs dynamic
  • Static: environment is fixed during decision making
  • Dynamic: environment changes
  • Suppose your robolackey is getting lunch for everyone at the office from

different restaurants. If you call up his cellphone (yes, your robolackey has a cellphone) and tell him to also pick up a sammich from Fearless Frank's, will he have to start over, or adapt?

  • Discrete vs Continuous
  • Discrete: finite # of states (measurements, values, ...)
  • Continuous: smooth, infinite scale
  • Single agent vs multi-agent
  • Single: one agent involved
  • Multi: more than one (adversary/competitive or cooperative)
slide-21
SLIDE 21

Back to Agents...

  • As a reminder, in AI, we want to design:
  • An agent function...

– A mapping of percepts to actions

  • ... as implemented as an agent program...

– i.e. the actual realization of that agent function

  • ... which can be combined with an architecture...

– A computing device or platform, which includes the

requisite sensors and actuators

  • ... to create an agent
  • i.e. architecture + program = agent
slide-22
SLIDE 22

Agent Types

  • Let's look at four basic kinds of agent

programs:

  • Simple reflex agents
  • Model-based reflex agents
  • Goal-based agents
  • Utility-based agents
slide-23
SLIDE 23

Simple Reflex Agents

  • The agent selects actions on the basis of the

current percept, and nothing else

  • Screw history
  • For example, if the current temperature is lower

than the requested temperature on a thermostat, then it might activate the furnace

  • It really doesn't care if you were previously throwing

giant globs of ice cream at it

  • Note: Does anyone have a thermostat/heating

control that actually follows this? What's it like?

slide-24
SLIDE 24

Model-based Reflex Agents

  • Remember that whole idea of a 'partially-observable

environment'?

  • Well, suppose you could model your environment, and then

remember aspects that you aren't currently perceiving!

  • For example, if you send your glasses-fetching cyborg to go... fetch

your glasses, then he'll probably assume you're still where he left you, even if he can't see through the walls

  • The key point is that we've expanded the basic reflex agent to

also include memory of state

  • Depending on implementation, that state can simply be incorporated

into the percept

  • Consider a simple wall-following robot. Can we envision a scenario

where something like this might be necessary?

slide-25
SLIDE 25

Goal-based Agents

  • It's all well and good that your chauffeurbot can

see the road and cars around it, and that he (it?) also assumes that your house hasn't blown

  • up. But how does that help him get you to

Brock?

  • If he's goal-based, then he'll make use of goal-
  • riented knowledge and do some planning
slide-26
SLIDE 26

Utility-based agents

  • If a goal is 'yes' or 'no' (i.e. Satisfied or unsatisfied),

then that might not provide much flexibility for determining relative performance

  • A utility function is an internalization of the

performance measure

  • If different actions might yield different degrees of

performance, it becomes easier to grade them

  • So using a wobbly spatula and using an air cannon

don't look like equal pancake-delivery systems to your chefdroid just because neither will successfully place your pancake perfectly centred onto your place

slide-27
SLIDE 27

Utility-based agents (cont)

  • In particular, utility functions can be helpful in either/both of the

following cases:

  • When there are two or more conflicting goals

– Sometimes goals need to be weighed against each other

  • e.g. a self-driving vehicle can aim for speed and safety, but eventually one will have to

trump the other

  • Several (non-conflicting) goals of questionable chances for success

– Maybe, instead of trading one for another, you're not certain you can achieve

any of them. You can still weight them so that some goal attempts are of higher priorities than others, or that it goes for the most likely to succeed

  • More generally, we'll be revisiting this concept with multiobjective

problems and heuristics

  • e.g. Vehicle routing, where you want to reduce both the total distance

driven and the total number of vehicles in use

slide-28
SLIDE 28

Learning Agents

  • We could also talk about generalized learning agents...
  • The previously defined agent is encompassed as a

'performance element'

  • A 'critic' evaluates the agent's performance based on an
  • bjective 'performance standard'
  • A 'learning element' receives feedback from the critic and

suggests changes to the performance element

  • A 'problem generator' creates new problems (for which the

performance element is expected to do poorly) to force it to adapt to a broader set of tasks

  • ... but I think it's a bit too esoteric and abstract, at least

for now

slide-29
SLIDE 29

Using Agents

  • We could create agents fitting the descriptions we've covered so far,

but that wouldn't really tell us how to design and use them

  • In practice, depending on the application, it could be as simple as

looking up simple discrete states in a table and mapping it to well- defined actions (an 'atomic representation')...

  • We could split up states into sets of attributes or balanced weights,

as in a 'factored representation'...

  • We could create an elaborate 'structured representation' that could

map known relationships to consequences and interactions...

  • and/or we could combine them (though I suppose that would also

arguably be structured)