Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 25

ARTIFICIAL

INTELLIGENCE
WEEK02

Jun 25, 2024 1


Today’s Agenda

■ Understanding AI
■Agents and environments
■Rationality
■PEAS (Performance measure, Environment, Actuators, Sensors)

■Environment types

■Agent types

Jun 25, 2024 2


Approaches to AI

■ The science of making machines that:

Jun 25, 2024 3


Think like Human:

“Cognitive approach”

Three ways to do this:


• Through introspection
• Through psychological experiments
• Through brain imaging

Jun 25, 2024 4


Systems Thinking like Humans
■ Formulate a theory of mind/brain
■ Express the theory in a computer program
■ Two Approaches:

Cognitive Science &


Cognitive Neuroscience
Psychology

Observing
Testing
Neurological data

Predicting responses Brainer: what is


of human subjects neural network?

Jun 25, 2024 5


Act like Human:
“Turing test approach”

Six disciplines are required:


• Natural language processing,
• Knowledge representation,
• Automated reasoning,
• Machine learning,
• Computer vision,
• Robotics
Jun 25, 2024 6
Systems Acting like Humans

■ Turing test: test for intelligent behaviour


– Interrogator writes questions and receives answers
– System providing the answers passes the test if interrogator cannot tell whether
the answers come from a person or not

■ Necessary components of such a system form major AI sub-disciplines:


– Natural language
– knowledge representation
– Automated reasoning
– Machine learning

Jun 25, 2024 7


Think Rationally:

“Laws of thought”

Obstacles in doing so:


• Not easy to state informal knowledge
in formal terms
• Big difference in solving a problem in
practical and to solve it in principle

Jun 25, 2024 8


Act Rationally:

“Rational agent approach”


Merits:
• More general than “laws of thought”
approach
• More adjustable to scientific development

This course is about designing rational/intelligent agents

Jun 25, 2024 9


AGENTS
&
ENVIRONMENTS

Jun 25, 2024 10


Agents:
■An agent is anything that can be viewed as
– perceiving its environment through sensors and

– acting upon that environment through actuators

– Assumption: Every agent can perceive its own actions (but not always the effects)

Jun 25, 2024 11


Agents:
Human agent:
– eyes, ears, and other organs for sensors;
– hands,legs, mouth, and other body parts for actuators

Robotic agent:
– cameras and infrared range finders for sensors;
– various motors for actuators

A software agent:
– Keystrokes, file contents, received network packages as sensors
– Displays on the screen, files, sent network packets as actuators

Jun 25, 2024 12


Agents and Environments

Jun 25, 2024 13


Agents and Environments
■Percept: agent’s perceptual input at any given instant
■Percept sequence: complete history of everything the agent has ever perceived
■An agent’s choice of action at any given instant can depend on the entire percept sequence
observed to date
■An agent’s behavior is described by the agent function which maps from percept histories to actions:
■ [f: P*  A]

■Internally, the agent function will be implemented by an agent program which runs on the
physical architecture to produce f:

■ agent = architecture + program

Jun 25, 2024 14


Vacuum-cleaner world  Two locations: A and B
One simple function is :  Percepts: location and
if the current square is dirty then suck, otherwise move to the other square contents, e.g., [A,Dirty]
Percept sequence Actions  Actions: Left, Right,
[A,Clean] Right Suck, NoOp
[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

Jun 25, 2024 15


RATIONAL AGENTS

Jun 25, 2024 16


■ An agent should strive to "do the right thing", based on what it can perceive and the
actions it can perform.

■ The right action is the one that will cause the agent to be most successful

■ Performance measure: An objective criterion for success of an agent's behavior

■E.g., performance measure of a vacuum-cleaner agent could be amount of dirt cleaned


up, amount of time taken, amount of electricity consumed, amount of noise generated, etc.

■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 (amount of dirt cleaned vs a clean floor)

■A more suitable measure would reward the agent for having a clean floor

Jun 25, 2024 17


Rationality:
■ What is rational at any given time depends on four things:
– The performance measure that defines the criterion of success

– The agent’s prior knowledge of the environment

– The actions that the agent can perform

– The agent’s percept sequence to date

 What is a 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.
Jun 25, 2024 18
Agent Function
■ a = F(p)
where p is the current percept, a is the action carried out, and F is the agent function

■ F maps percepts to actions:


F: P  A
where P is the set of all percepts, and A is the set of all actions

In general, an action may depend on all percepts observed so far, not just the
current percept, so…

Jun 25, 2024 19


Agent Function Refined

ak = F(p0 p1 p2 …pk)

where p0 p1 p2 …pk is the sequence of percepts observed to date, ak is the


resulting action carried out

F: P* -> A
the agent function maps from percept histories to actions

Jun 25, 2024 20


PEAS

■ PEAS: Performance measure, Environment, Actuators, Sensors

■ Must first specify the setting for intelligent agent design

■ Consider, e.g., the task of designing an automated taxi driver:


– Performance measure

– Environment

– Actuators

– Sensors

Jun 25, 2024 21


PEAS
■ Must first specify the setting for intelligent agent design

■ Consider, e.g., the task of designing an automated taxi driver:


– Performance measure: Safe, fast, legal, comfortable trip, maximize profits

– Environment: Roads, other traffic, pedestrians, customers

– Actuators: Steering wheel, accelerator, brake, signal, horn

– Sensors: Cameras, sonar, speedometer, GPS, odometer, engine sensors,


keyboard

Jun 25, 2024 22


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

Jun 25, 2024 23


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

Jun 25, 2024 24


PEAS: example 3

■ Agent: Interactive English tutor


■ Performance measure: Maximize student's score on test
■ Environment: Set of students
■ Actuators: Screen display (exercises, suggestions, corrections)
■ Sensors: Keyboard

Jun 25, 2024 25

You might also like