fbbm509 - artificial...

40
FBBM509 - Artificial Intelligence Intelligent Agents

Upload: others

Post on 22-Jun-2020

20 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

FBBM509 - Artificial Intelligence

Intelligent Agents

Page 2: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

AI Perspectives

Page 3: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Acting Humanly

Possess following capabilities:

– Natural language processing to enable it communicate successfully in English;

– Knowledge representation to store what it knows or hears;

– Automated reasoning to use stored information to answer questions and to draw new conclusions;

– Machine learning to adapt to new circumstances and to detect and extrapolate patterns.

Page 4: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Acting Humanly (2)

Total Turing Test – includes a video signal– computer vision to perceive objects, and

– Robotics to manipulate objects and move about.

Six disciplines compose most of AI: test remains relevant 60 years later.

Little effort to pass Turing test: study underlying principles instead.

Page 5: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Thinking Humanly

We need to get inside the actual workings of human mind.

Three ways to do this:

– Introspection: catch our own thoughts as they go by– Psychological experiments: observe a person in action– Brain imaging: observer the brain in action

Once we have a sufficiently precise theory of the mind, express the theory as a computer program.

Cognitive science: brings together computer models from AI and experimental techniques from psychology to construct precise and testable theories of the human mind.

Page 6: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Thinking Rationally

Aristotle: – first to attempt to codify “right thinking”

– Irrefutable reasoning process

– “Socrates is a man; all men are mortal, therefore, Socrates is mortal.”

Logicians in the 19th century developed a precise notation for statements about all kinds of objects in the world and the relations among them.

Page 7: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Thinking Rationally (2)

By 1965, programs existed that could, in principle, solve anysolvable problem described in logical notation.

Logicist tradition within artificial intelligence hopes to build on such programs to create intelligent systems.

Two main obstacles:– Taking informal knowledge and stating it in the formal

terms required by logical notation is not easy

– Big difference between solving a problem “in principle” and solving it in practice

Page 8: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Acting Rationally

An agent is just something that acts (agent comes from the Latin agere, to do)

A rational agent is an agent that acts so as to achieve the best outcome or, when there is uncertainty, the best expected outcome.

– Operate autonomously– Perceive the environment – Persist over a prolonged time period– Adapt to change– Create and pursue goals

Performance measure: evaluates any given sequence of environment states.

Page 9: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Agents and Environments

Agents interact with environments through sensors and actuators.

Human agent: eyes, ears, other organs; hands, legs…Robotic agent: cameras, infrared range finders; various motors.

Page 10: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Acting Rationally

Agent behavior is described by:

Percept: agent’s perceptual inputs at any given instant.

Perceptual sequence: the complete history of everything the agent has ever perceived.

Agent function maps any given percept sequence to an action. -> abstract mathematical description of the behavior

Agent program is the concrete implementation of the agent function running within some physical system.

Page 11: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Vacuum Cleaner World

Two locations: squares A and B

Vacuum agent perceives: (1) which square it is in and (2) whether there is dirt in the square

Actions: (1) move left, (2) move right (3) suck up the dirt and (4) do nothing

Page 12: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Simple Agent Function with Tabulation

Page 13: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Agents and Environments - PEAS

Page 14: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Properties of Task Environment

Observable: (1) fully observable and (2) partially observable

Agents: (1) single agent and (2) multiple agent

• Competitive (randomized behavior)• Cooperative• Communication

Deterministic: (1) deterministic and (2) stochastic

Episodic: (1) episodic and (2) sequential

• Current decision can effect all future decisions• Short term actions can have long term consequences

Page 15: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Properties of Task Environment (2)Static: (1) static and (2) dynamic

• If the environment can change while and agent is deliberating

Discrete: (1) discrete and (2) continuous

• States, percepts or actions

Known: (1) known and (2) unknown

• Agent’s (or designer’s) state of the knowledge about the “laws of physics” of the environment

• In a known environment, outcomes for all actions are given.• Known but partially observable – solitaire card games• Unknown but fully observable – a new video game

Page 16: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Examples of Environments

Page 17: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Structure of AgentsArchitecture: computing device with physical sensors and actuators

• agent = architecture + program• Program we develop should be appropriate for the

architecture

Kinds of agent programs:

• Simple reflex agents• Model-based reflex agents• Goal-based agents• Utility-based agents

Page 18: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Table-driven Agent

Page 19: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Vacuum Cleaner World

Page 20: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Table-driven Agent

P: set of possible perceptsT: lifetime of the agent (total number of percepts it will receive)

Number of lookup table entries: ∑ |�|�����

Number of atoms in the observable universe < 10��

Page 21: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Simple Reflex Agent

Simple reflex agents select actions on the basis of the current percept, ignoring the rest of percept history.

Page 22: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Simple Reflex Agent for Vacuum World

Compared to table-driven agent, the simple reflex agent for the vacuum world is very small.

Reduction comes from ignoring the percept history. Number of possibilities is just 4, instead of 4�.

Condition-action rules, situation-action rules, productions or if-then rules.

Page 23: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Simple Reflex Agent Algorithm

INTERPRET-INPUT: generates an abstracted description of the current state.

RULE-MATCH: returns the first rule in the set of rules that matches the given state description.

Page 24: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Simple Reflex AgentsUseful for more complex environments too:

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

Disadvantage-1: works only if the correct decision can be made on the basis of only the current percept (fully observable env.)

Disadvantage-2: Infinite loops are often unavoidable in partially observable environments.

• For escaping from infinite loops, randomize actions

Page 25: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Model-based Reflex Agent (1)

A way to handle partial observability:

• Keep track of the world you can’t see now• Maintain some sort of internal state

Updating this internal state requires two kinds of knowledge:

• Information about how the world evolves independently of the agent

• Information about how the agent’s own actions affect the world

Page 26: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Model-based Reflex Agent (2)

This knowledge about “how the world works” is called a modelof the world.

An agent that uses such a model is called model-based agent.

The details of how models and states are represented vary widely depending on

• the type of environment and • the particular technology used in the agent design.

Page 27: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Model-based Reflex Agent (2)

Page 28: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Model-based Reflex Agent Algorithm

UPDATE-STATE: creates the new internal state description.

What the world is like now: It is seldom possible for the agent to determine the current state of a partially observable environment exactly.

Page 29: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Goal-based Agent

Deciding what to do: Knowing something about the current state of the environment is not always enough.

Example: At a road junction, the taxi can turn left, turn right or go straight on. The correct decision depends on where the taxi is trying to get to.

The agent program needs some sort of goal information that describes situations that are desirable.

Page 30: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Goal-based Agent

Page 31: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Goal-based Agent – Search, Planning and Flexibility

Sometimes goal-based action selection is straightforward (goal satisfaction after a single action).

Sometimes requires long action sequences (e.g. going from department to home).

Search and Planning are subfileds of AI devoted to finding action sequences that achieve the agent’s goals.

Goal-based agent appears less efficient than reflex agent, but it is more flexible (e.g. what if a traffic jam exist on the planned road?).

Page 32: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Utility-based Agent

Goals alone are not enough to generate high-quality behavior in most environments.

Example: Many action sequences will get the taxi to its destination (thereby achieving the goal) but some are quicker, safer, more reliable, or cheaper than others.

Goals just provide a crude binary distinction between “happy” and “unhappy” states.

A more general performance measure should allow a comparison of different world states according to exactly how happy they would make the agent: utility

Page 33: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Utility-based Agent: Utility Function

Performance measure: assigns a score to any given sequence of environment states.

Utility function: an internalization of the performance measure.

If the internal utility function and the external performance measure are in agreement:

• agent chooses actions to maximize it utility• rational according to the external performance measure

Page 34: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Utility-based Agent

Page 35: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Goal-based Agent vs. Utility-based Agent

In two kinds of cases, goals are inadequate but a utility-based agent can still make rational decisions:

1. When there are conflicting goals, only some of which can be achieved

2. When there are several goals that the agent can aim for, none of which can be achieved with certainty• utility provides a way in which the likelihood of

success can be weighted against the importance of the goal.

Partial observability and stochasticity are ubiquitous in the real world: choosing the action that maximizes the expected utility

Page 36: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Learning Agent

Performance element: responsible for selecting external actions.Critic: Sends feedback on how the agent is doing. Learning element: responsible for making improvements. Modifies performance element to do better in the future.Problem generator: responsible for suggesting actions that will lead to new and informative experiences.

Page 37: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Components of Agent Programs

Page 38: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Atomic Representation

Each state of the world is indivisible (no internal structure)

Example: Route finding between cities. Each city is a different state.

Methods using this representation:

• Search and Game Playing (Ch 3-5)• Hidden Markov Models (Ch 15)• Markov Decision Processes (Ch 17)

Page 39: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Factored Representation

Splits up each state into a fixed set of variables or attributes, each of which can have a value. Can represent uncertainty.

Example: Route finding with more concerns: how much gas in the tank, our current GPS coordinates, what station is on the radio, and so on.

Methods using this representation:

• Constrained Satisfaction (Ch 6)• Propositional Logic (Ch 7)• Planning (Ch 10 and 11)• Bayesian Networks (Ch 13-16)• Machine Learning (Ch 18, 20 and 21)

Page 40: FBBM509 - Artificial Intelligenceleventbayindir.net/wp-content/uploads/2014/02/fbbm509-hafta1-2.pdf · FBBM509 - Artificial Intelligence Intelligent Agents. AI Perspectives . Acting

Structured Representation

The world as having things in it that are related to each other, not just variables with values.

Example: Route finding: a large truck ahead of us is reversing into the driveway of a dairy farm but a cow hos got loose and is blocking the truck’s path.

TruckAheadBackingIntoDairyFarmDrivewayBlockedByLooseCow=true

Methods using this representation:

• Rel. Databases and First-order Logic (Ch 8, 9 and 12)• First-order Probability Models (Ch 14)• Knowledge-based Learning (Ch 19)• Natural Language Understanding (Ch 22 and 23)