0% found this document useful (0 votes)
42 views75 pages

CS 2 S2 Cluster ACI

The document outlines an introduction to intelligent agents course, including an overview of the modules which cover topics such as problem solving using search, game playing, knowledge representation, probabilistic reasoning, and reinforcement learning. It also discusses the rational agent approach for designing agents to achieve the best expected outcome even under uncertainty, and how an agent's task environment is defined by factors including observability, dependency of actions, number of states, determinism, and single vs multi-agent systems.

Uploaded by

indgok
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views75 pages

CS 2 S2 Cluster ACI

The document outlines an introduction to intelligent agents course, including an overview of the modules which cover topics such as problem solving using search, game playing, knowledge representation, probabilistic reasoning, and reinforcement learning. It also discusses the rational agent approach for designing agents to achieve the best expected outcome even under uncertainty, and how an agent's task environment is defined by factors including observability, dependency of actions, number of states, determinism, and single vs multi-agent systems.

Uploaded by

indgok
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 75

Artificial & Computational Intelligence

DSE CLZG557
M1 : Introduction to Intelligent Agents
Gokul Kannan S
Guest Faculty,
BITS Pilani BITS - CSIS
Pilani Campus
Course Plan

M1 Introduction to AI

M2 Problem Solving Agent using Search

M3 Game Playing, Constraint Satisfaction Problem

M4 Knowledge Representation using Logics

M5 Probabilistic Representation and Reasoning

M6 Reasoning over time, Reinforcement Learning

BITS Pilani, Pilani Campus


Module 1 : Introduction to AI

A. Overview of AI & Applications

B. Intelligent Agents

C. Task Environment

BITS Pilani, Pilani Campus


Rational Agents

BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


Rational Agent

Design Principles & Techniques

BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


Acting Rationally
The Rational Agent Approach

• An agent is an entity that perceives and acts


This course is about designing rational agents
• Abstractly, an agent is a function from percept histories to actions:
[f: P* → A]
• For any given class of environments and tasks, we seek the agent (or class of
agents) with the best performance
• Computational limitations make perfect rationality unachievable
• Design best program for given machine resources

BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


Acting Rationally
The Rational Agent Approach

• Rational behaviour: doing the right thing


• The right thing: that which is expected to maximize goal achievement, given the
available information
• Rational behaviour is not just about correct inference / thinking, skills needed to
pass turing test etc.
(adv) : More General - Correct inference is just a thing
(adv) : More amenable for scientific developments, as the rational behaviour is
better defined than human thinking and behaviour

BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


Intelligent Agent

Rational Agent is one that acts to achieve the best outcome or the best expected
outcome even under uncertainty

Maps / Tabulated / Programmed

Percept Agent Actio


Sequenc Function n
e

BITS Pilani, Pilani Campus


Intelligent Agent

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

E.g., performance measure of a vacuum-cleaner agent


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

BITS Pilani, Pilani Campus


Intelligent Agent

BITS Pilani, Pilani Campus


Properties of Rational Agent

⮚ Omniscience : Expected Vs Actual Performance

⮚ Learning Capability : Apriori Knowledge

⮚ Autonomous in decision making: An agent is autonomous if its behaviour is

determined by its own experience (with ability to learn and adapt)

BITS Pilani, Pilani Campus


Design on what an application wants the
PEAS Environment agent to do in the environment

Agent Performance Environment Sensors Actuators

Medical Healthy patient, Patient, Keyboard entry of Display of


diagnosis reduced costs hospital, staff symptoms, questions, tests,
system findings, patient’s diagnosis,
answers treatments,
referrals

Satellite Image Correct image Downlink Color pixel analysis Display of scene
analysis categorization from orbiting categorization
system satellite

Interactive Student’s score Set of Keyboard entry Display of


English tutor on test students, exercises,
testing suggestions,
agency corrections

BITS Pilani, Pilani Campus


PEAS Environment Design on what an application wants the
agent to do in the environment

Agent Performance Environment Sensors Actuators

Automated Safe, fast, legal, Roads, other Cameras, sonar, Steering wheel,
taxi driver comfortable trip, traffic, speedometer, GPS, accelerator, brake,
maximize profits pedestrians, odometer, signal, horn
customers engine sensors,
keyboard

BITS Pilani, Pilani Campus


Task Environment

A rational agent is built to solve a specific task. Each such task would then have a
different environment which we refer to as Task Environment

Based on the applicability of each technique for agent implementation its task
environment design is determined by multiple dimension
Sensor Based:
⮚ Observability : Full Vs Partial

BITS Pilani, Pilani Campus


Task Environment

Action Based:
⮚ Dependency : Episodic Vs Sequential

BITS Pilani, Pilani Campus


Task Environment

State Based:
⮚ No.of.State : Discrete Vs Continuous

BITS Pilani, Pilani Campus


Task Environment

State Based:
⮚ No.of.State : Discrete Vs Continuous

BITS Pilani, Pilani Campus


Task Environment

State Based:
⮚ No.of.State : Discrete Vs Continuous

BITS Pilani, Pilani Campus


Task Environment

Action & State Based:

⮚ State Determinism : Deterministic Vs Stochastic | Strategic


(If the environment is deterministic except for the actions of other agents, then the
environment is strategic)

BITS Pilani, Pilani Campus


Task Environment

Agent Based:
> Cardinality : Single Vs MultiAgent

BITS Pilani, Pilani Campus


Task Environment

Action & State Based:


⮚ Change in Time : Static Vs Dynamic
⮚ (The environment is semi dynamic if the environment itself does not change with
the passage of time but the agent's performance score does)

BITS Pilani, Pilani Campus


Task Environment

Sensor Based:
⮚ Observability : Full Vs Partial

Action Based:
⮚ Dependency : Episodic Vs Sequential

State Based:
⮚ No.of.State : Discrete Vs Continuous

Agent Based:
> Cardinality : Single Vs MultiAgent

Action & State Based:


⮚ State Determinism : Deterministic Vs Stochastic | Strategic
⮚ Change in Time : Static Vs Dynamic

BITS Pilani, Pilani Campus


Task Environment

Task Fully vs Single vs Deterministic Episodic vs Static vs Discrete


Environme Partially Multi- vs Stochastic Sequential Dynamic vs
nt Observable Agent Continuo
us
Medical Partially Single Stochastic Sequential Dynamic Continuou
diagnosis s
system
Satellite Fully Single Deterministi Episodic Static Continuou
Image c s
Analysis
System
Interactive Partially Multi Stochastic Sequential Dynamic Discrete
English tutor

BITS Pilani, Pilani Campus


Task Environment

Task Fully vs Single Deterministic Episodic vs Static vs Discrete


Environm Partially vs vs Stochastic Sequential Dynamic vs
ent Observable Multi- Continuou
Agent s
Taxi P M S S D C
Driving
Timed F M Strategic S SemiDyna D
Chess mic
Game

BITS Pilani, Pilani Campus


Agent Architectures
Reflex Agent

BITS Pilani, Pilani Campus


Agent Architectures
Model based Agent

BITS Pilani, Pilani Campus


Agent Architectures
Model based Agent

BITS Pilani, Pilani Campus


Agent Architectures
Goal based Agent

BITS Pilani, Pilani Campus


Agent Architectures
Utility based Agent

BITS Pilani, Pilani Campus


Agent Architectures
Learning Agent

BITS Pilani, Pilani Campus


Agent Architectures - Components
Learning Agent
Agents that improve their performance by learning from their own experiences

Input Percept Output Action

Performance APPLY
Element BRAKE

Resulting State Feedback

Critic -2

BITS Pilani, Pilani Campus


Agent Architectures - Components
Learning Agent

Input Possible Selected


Percept Actions Action

Brake
Change Gear
to Lower
Change Gear Rand
to Higher om Change Gear
Accelerate
to Lower
Steer left
Steer right

BITS Pilani, Pilani Campus


Agent Architectures - Components
Learning Agent

Go
al

High Low
er er
Utilit Utilit
y y

BITS Pilani, Pilani Campus


Agent Architectures - Components
Learning Agent

Critic – Provides feedback on the actions taken

Learning :
Supervised Vs Unsupervised Vs Reinforcement

BITS Pilani, Pilani Campus


Agent Architectures - Components
Learning Agent

Go
al

High Low
er er
Utilit Utilit
y y

BITS Pilani, Pilani Campus


Required Reading: AIMA - Chapter # 1.2, 1.4, 2

Thank You for all your Attention

Note : Some of the slides are adopted from AIMA TB materials


36
BITS Pilani, Pilani Campus
Module 2 : Problem Solving Agent using Search

A. Uninformed Search

B. Informed Search

C. Heuristic Functions

D. Local Search Algorithms & Optimization Problems

BITS Pilani, Pilani Campus


Problem Formulation

BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


Problem Solving Agents

Goal based decision making agents which finds sequence of actions that leads to
the desirable stated.
Phases of Solution Search by PSA
Goal
Formulatio
n

Problem
Formulatio
n

Search
Phase

Execution
Phase
BITS Pilani, Pilani Campus
Problem Solving Agents

Goal based decision making agents which finds sequence of actions that leads to
the desirable stated.
Phases of Solution Search by PSA
Goal
Formulatio Optimizes the Objective (Local | Global)
n Limits the Actions

Problem
Formulatio
n

Search
Phase

Execution
Phase
BITS Pilani, Pilani Campus
Problem Solving Agents

Phases of Solution Search by PSA


Goal
Formulatio
n

Problem State Space Creations [in the path of Goal]


Formulatio
n Lists the Actions

Search
Phase

Execution
Phase

BITS Pilani, Pilani Campus


Problem Solving Agents

Phases of Solution Search by PSA


Goal
Formulatio
n Assumptions – Environment :
Static
Observable
Problem Discrete
Formulatio
n Deterministic

Search
Phase

Execution
Phase

BITS Pilani, Pilani Campus


Problem Solving Agents
Phases of Solution Search
Goal
Formulatio
n

Problem
Formulatio
n

Search Examine all sequence


Phase Choose best | Optimal

Execution
Phase

BITS Pilani, Pilani Campus


Problem Solving Agents – Problem Formulation

Abstraction Representation
Decide what actions under states to take to achieve a goal
5
Components

Initial State Possible Successor Goal Test Path Cost


Action Function |
Transition
| Operators
Model

A function that assigns a numeric cost to each path. A path is a series of actions. Each
action is given a cost depending on the problem.

Solution = Path Cost Function + Optimal Solution

BITS Pilani, Pilani Campus


Problem Solving Agents – Problem Formulation

Initial State –E.g., In(Arad)


Possible Actions – ACTIONS(s) 🡺 {Go(Sibiu), Go(Timisoara), Go(Zerind)}
Transition Model – RESULT( In(Arad), Go(Sibiu) ) = In(Sibiu)
Goal Test – IsGoal( In(Bucharest) ) = Yes
Path Cost – cost( In(Arad), go(Sibiu)) = 140 kms

BITS Pilani, Pilani Campus


N - Queen

BITS Pilani, Pilani Campus


Vacuum World Problem

BITS Pilani, Pilani Campus


Example Problem Formulation

Vacuum World 8 – Queen Problem Travelling Problem

Initial State Any No Queen on Based on the problem


board
Possible [Move Left, Move Add a Queen to Take a flight | Train |
Actions Right, Suck] any empty square Shop
Transition [A, ML] = [B , [A1, B2] = [FAIL] [A, Go(A->S)] = [S]
Model Dirty] [A1, B3] = [SAFE]
[A, ML] = [B,
Clean]
Goal Test Is all room clean? All Queen Safe Is current = B
[A, Clean] [B, (destination)
Clean]
Path Cost No of steps in No of Moves Cost + Time + Quality
path done,
backtracking
BITS Pilani, Pilani Campus
Searching for Solutions

Choosing the current state, testing possible successor function, expanding current
state to generate new state is called Traversal. Choice of which state to expand –
Search Strategy

Search Strategy (under


certainty)

Uninformed Informed
BFS, DFS, UCS Best First Search
IDS, DLS A*
Bi-Directional AO*

BITS Pilani, Pilani Campus


In(Arad)

Go(Sibiu) Go(Timisoara) Go(Zerind)

In(Sibiu) In(Timisoara) In(Zerind)

Go(Arad) Go(Fagaras) Go(Oradea) Go(Rimnicu Vilcea)

In(Arad) In(Fagaras) In(Oradea) In(Rimnicu Vilcea)

Leaf Nodes
(no children yet)

BITS Pilani, Pilani Campus


Terminologies

⮚ Nodes
⮚ States
⮚ Frontier | Fringes
⮚ Search Strategy : LIFO | FIFO | Priority Queue
⮚ Performance Metrics

⮚ Completeness
⮚ Optimality
⮚ Time Complexity
⮚ Space Complexity
⮚ Algorithm Terminology
- d Depth of a node - m – maximum
- b Branching factor - C* - Optimal Cost
- n – nodes - E – least Cost
- l – level of a node - N –total node generated

BITS Pilani, Pilani Campus


Uninformed Search
BFS & its Variants

BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


Breadth First Search (BFS)

Generate all nodes at a given depth


before proceeding to deeper nodes

BITS Pilani, Pilani Campus


Breadth First Search (BFS)

BITS Pilani, Pilani Campus


BFS – Uninformed Problem

1
75
70 Initial state=1
125
100 Goal=5
5
125
2
125 2, 3, 4
75
50 50 Check 2: No
5, 3
4 3, 4, 5
3
100
Check 3: No
(1) 4, 5

Check 4: No
5

Check 5: Yes

BITS Pilani, Pilani Campus


Breadth First Search – Evaluation

Why is Space Complexity a big problem? Imagine a problem with


– branching factor b = 10
– generates 1 million nodes/sec
– Each node requires 1KB

BITS Pilani, Pilani Campus


Breadth First Search – Evaluation

BITS Pilani, Pilani Campus


Uniform Cost Search

Instead of expanding the shallowest node, Uniform-Cost search expands the node n
with the lowest path cost g(n)

Sorting the Frontier as a priority queue ordered by g(n)

Goal test is applied during expansion


– The goal node if generated may not be on the optimal path
– Find a better path to a node on the Frontier

BITS Pilani, Pilani Campus


Uniform Cost Search

Current State: Sibiu

Frontier: []

Step: Expand Sibiu

Result: Generates (“Rimnicu Vilcea” 80)


(“Fagaras”, 99)
Add to Frontier

Initial State: Sibiu


Goal State: Bucharest

BITS Pilani, Pilani Campus


Uniform Cost Search

Current State: Sibiu

Frontier: [(“Rimnicu Vilcea” 80)


(“Fagaras”, 99)]

Step: Expand “Rimnicu Vilcea” (least cost)

Result: Generates (“Pitesti”, 177)


Add to Frontier

Initial State: Sibiu


Goal State: Bucharest

BITS Pilani, Pilani Campus


Uniform Cost Search

Current State: Rimnicu Vilcea (not a Goal state)

Frontier: [ (“Fagaras”, 99)


(“Pitesti”, 177)]

Step: Expand “Fagaras” (least cost)

Result: Generates (“Bucharest”, 310)


Add to Frontier
(It’s a Goal State but we won’t
test during generation)

Initial State: Sibiu


Goal State: Bucharest

BITS Pilani, Pilani Campus


Uniform Cost Search

Current State: Fagaras (not a goal state)

Frontier: [ (“Pitesti”, 177)


(“Bucharest”, 310)]

Step: Expand “Pitesti” (least cost)

Result: Generates (“Bucharest”, 278)


Replace in Frontier
(It’s a Goal State but we won’t
test during generation)

Initial State: Sibiu


Goal State: Bucharest

BITS Pilani, Pilani Campus


Uniform Cost Search

Current State: Pitesti (not a goal state)

Frontier: [ (“Bucharest”, 278)]

Step: Expand “Bucharest”

Result: No further generation


as Goal Test satisfied
Return Solution

Initial State: Sibiu


Goal State: Bucharest

BITS Pilani, Pilani Campus


UCS– Uninformed Problem

1
75
70
125
100
5
125
2
125
75
50 50

3 4
100

(1)

Current State Frontier

1 2 (70), 4(100), 3 (125)

BITS Pilani, Pilani Campus


Uninformed Search
DFS & its Variants
Depth First Search (DFS)

• Uses LIFO as the Frontier Strategy


• Expands deepest node in current Frontier
• Instance of Graph Search Algorithm

BITS Pilani, Pilani Campus


Depth First Search (DFS)

BITS Pilani, Pilani Campus


DFS – Uninformed – Problem

1
75
70
125
100
5
125
2
125
75
50 50

3 4
100

(1)

BITS Pilani, Pilani Campus


Depth First Search (DFS)

BITS Pilani, Pilani Campus


Depth Limited Search (DLS)

BITS Pilani, Pilani Campus


Iterative Deepening Depth First Search (IDS)

BITS Pilani, Pilani Campus


Iterative Deepening Depth First Search (IDS)

BITS Pilani, Pilani Campus


Iterative Deepening Depth First Search (IDS)

BITS Pilani, Pilani Campus


Application

Breadth First Search

⮚ Finding path in a graph (many solutions)

⮚ Finding the Bipartitions in a graph

Depth First Search

⮚ Find the Connectedness in a graph

⮚ Topological Sorting

BITS Pilani, Pilani Campus


Required Reading: AIMA - Chapter # 3.1, 3.2

Thank You for all your Attention

Note : Some of the slides are adopted from AIMA TB materials


75

You might also like