ai Unit full
ai Unit full
ARTIFICIAL INTELLIGENCE
UNIT – 1
CLR1 : Provide a broad understanding of the basic techniques for building intelligent computer systems and an understanding of
how AI is applied to problems.
HUMAN RATIONAL
Systems that act like humans:
Turing Test
?
• You enter a room which has a computer
terminal. You have a fixed period of time to
type what you want into the terminal, and
study the replies. At the other end of the line is
either a human being or a computer system.
• If it is a computer system, and at the end of the
period you cannot reliably determine whether
it is a system or a human, then the system is
deemed to be intelligent.
Systems that act like humans
– Robotics
HUMAN RATIONAL
Systems that think like humans:
cognitive modeling
HUMAN RATIONAL
Systems that think ‘rationally’
"laws of thought"
HUMAN RATIONAL
Systems that act rationally:
“Rational agent”
• Rational behavior: doing the right thing
• The right thing: that which is expected to
maximize goal achievement, given the
available information
• Giving answers to questions is ‘acting’.
• I don't care whether a system:
– replicates human thought processes
– makes the same decisions as humans
– uses purely logical reasoning
Systems that act rationally
• Philosophy
– At that time, the study of human intelligence
began with no formal expression
– Initiate the idea of mind as a machine and its
internal operations
The Foundation of AI
• Psychology
– How do humans think and act?
– The study of human reasoning and acting
– Provides reasoning models for AI
– Strengthen the ideas
• humans and other animals can be considered as
information processing machines
The Foundation of AI
• Computer Engineering
– How to build an efficient computer?
– Provides the artifact that makes AI application
possible
– The power of computer makes computation of
large and difficult problems more easily
– AI has also contributed its own work to computer
science, including: time-sharing, the linked list
data type, OOP, etc.
The Foundation of AI
• Linguistics
– For understanding natural languages
• different approaches has been adopted from the
linguistic work
– Formal languages
– Syntactic and semantic analysis
– Knowledge representation
The main topics in AI
– increased costs
– difficulty with software development - slow and
expensive
– few experienced programmers
– few practical products have reached the market
as yet.
AI – Social Companion
AI in Movies
AI Applications
AI Defined
● Textbook definition:
• Heuristic Search
• Computer Vision
• Adversarial Search (Games)
• Fuzzy Logic
• Natural Language Processing
• Knowledge Representation
• Planning
• Learning
Examples
– Use of knowledge
– Abstraction
1. Search:-
• Search provides a way of solving problems for which no more direct approach is available as
well as a framework into which any direct techniques that are available can be embedded.
A search program finds a solutions for a problem by trying various sequences of actions or
operators until a solution is found.
Advantages
• It is the best way so far as no better way has been found to solve the problems.
• To solve a problem using search, it is only necessary to code the operator that can be used;
the search will find the sequence of actions that will provide the desired results.
Disadvantages
• Most problems have search spaces so large that it is impossible to search for the whole
space.
AI Techniques
2. Use of knowledge:-
• The use of knowledge provides a way of solving complicated problems by manipulating the structures
of the objects that are concerned.
• The way in which knowledge can be represented for usage in AI techniques:
• AI technique is a method that achieves knowledge that should be represented in such a way that:-
• Knowledge captures generalization. This meaning grouping situations that share important properties
rather than representing each situation separately with such an arrangement of knowledge, an
unreasonable amount of memory, and updating will no longer be required. Anything without this
property is called data rather than knowledge.
• It should be represented in such a way that it can be understood by the people who must prepare it.
For many programs, the size of the data can be achieved automatically by taking a reading from a
number of instruments, but in many AI areas, most of the knowledge a program has must be provided
by people in terms that they understand it.
• It could easily be adjusted to correct errors end to demonstrate changes in the world.
• It can be used to overcome its own through volume by helping to restrict the range of possibilities that
must usually be considered or discussed.
• It could be used in different situations even though it may not entirely be complete.
3. Abstraction:-
• Abstraction finds a way of separating important features and notifications from the unimportant ones
AI Techniques
AI technique is a method that exploits knowledge that should be represented in
such a way that:
1. The knowledge captures generalizations
2. It can be understood by people who must
provide it.
3. It can easily be modified to correct errors
4. It can be used in a great many situations even if
it is not totally accurate or complete
5. It can be used to help overcome its own sheer
bulk by helping to narrow the range of
possibilities that must usually be considered.
AI Techniques
• Problem Solving in games such as “Sudoku” can be an example. It can be done by building
an artificially intelligent system to solve that particular problem. To do this, one needs to
define the problem statements first and then generating the solution by keeping the
conditions in mind.
• Some of the most popularly used problem solving with the help of artificial intelligence
are:
– Chess.
– Travelling Salesman Problem.
– Tower of Hanoi Problem.
– Water-Jug Problem.
– N-Queen Problem.
• Problem Searching
• In general, searching refers to as finding information one needs.
• Searching is the most commonly used technique of problem solving in artificial
intelligence.
• The searching algorithm helps us to search for solution of particular problem.
Problem Solving In AI : Introduction
• Problem
• Problems are the issues which comes
across any system. A solution is
needed to solve that particular
problem.
• Steps : Solve Problem Using Artificial
Intelligence
• The process of solving a problem
consists of five steps. These are:
Problem Solving In AI : Introduction
Structured Problem
Well structed – Yield a right answer
Ill structed – Do not yield a particular answer
Unstructured Problem
Very hard to formulate the problem
Ambiguous in nature
Linear Problem
Have clear solution
All kind of classification problems
Non linear Problem
Relationships between input and output is non linear
Further decision can’t be taken like in linear problem
50
Unit 1 List of Topics
• Introduction to AI-AI techniques •Types of agents
• Problem solving with AI •Other aspects of agents
52
AI Models
53
AI Models
• Semiotic Models
- Based on Sign processes / signification and communication.
- Code is specific which gives meaning to each sign based on the sound or letters
that human use to form words or movements.
• Statistical Models
- Refers to representation and formulation of relationships through statistical
techniques.
- Statistical model employs probabilistic approaches and is typically a collection of
probability density function and distribution functions.
54
Unit 1 List of Topics
• Introduction to AI-AI techniques
• Problem solving with AI •Types of agents
•Other aspects of agents
• AI Models, Data acquisition and
learning aspects in AI •Constraint satisfaction
• Problem solving- Problem solving problems(CSP)
process, Formulating problems •Crypto arithmetic puzzles
Problem Solving – Is an area to deal with finding answer for some unknown situations.
It involves
Understanding
Representation
Formulation
Solving
1. General Purpose
2. Special purpose
Goal : Be in Bucharest
Formulate problem :
States: various cities
Actions: drive between cities
Solution:
Appropriate sequence of cities
e.g.: Arad, Sibiu, Fagaras, Bucharest
Problem Solving with AI
“ Formulate , Search , Execute “ design for agent
• The initial state that the agent starts in /Starting state which agent knows
itself.
• Ex- The initial state for our agent in Romania might be described as In(Arad)
• The step cost of taking action a to go from one state ‘s’ to reach state ‘y’ is
denoted by c(s, a, y).
Ex- For the agent trying to get to Bucharest, time is of the essence, so the cost of a
path might be its length in kilometres. We assume that the cost of a path can be
described as the sum of the costs of the individual actions along the path. The step
costs for Romania are shown in Figure as route distances. We assume that step costs
are nonnegative.
• A solution to a problem is an action sequence that leads from the initial state
to a goal state. Solution quality is measured by the path cost function, and an
optimal solution has the lowest path cost among all solutions.
Formulating Problems
69
Problem Types
2. Non-observable(Multiple-state problems) /
conformant problems
• Problem – solving agent does not have any
information about the state.
• Solution may or may not be reached.
• Ex- In case of vacuum cleaner , the goal state is to clean the floor rather
clean floor. Action is to suck if there is dirt. So , in non-observable condition
, as there is no sensor , it will have to suck the dirt , irrespective of whether
it is towards right or left . Here , the solution space is the states specifying
its movement across the floor.
Problem Types
3. Non-deterministic(partially observable) problem
• The effect of action is not clear.
• Percepts provide new information about the current
state.
• Ex- If we take Vacuum cleaner , and now assume that the
sensor is attached to it , then it will suck if there is dirt.
Movement of the cleaner will be based on its current
percept.
Problem Types
Competitive/ Cooperative
Problem Types
4. Unknown state space problems
• Typically exploration problems
• States and impact of actions are not
known
• Ex- online search that involves acting without compete knowledge
of the next state or scheduling without map.
Problem Characteristics
1. Is the problem decomposable ?
2. Can Solution steps be ignored or undone ?
3. Is the Universe Predictable?
4. Is a good solution absolute or relative ?
5. Is the solution a state or a path?
6. What is the role of knowledge?
7. Does the task require interaction with a
person ?
Problem Characteristics- 1. Is the problem decomposable ?
BLOCKS WORLD
Problem Characteristics: 2. Can Solution steps be ignored or undone ?
The 8 – Puzzle
Initial state:
monkey on
ground
with empty hand
bananas
suspended
Goal state:
monkey eating
Actions:
climb chair/get
off
grab X
• • Problem solving: The term, Problem Solving relates to analysis in AI.
Problem solving may be characterized as a systematic search through a
range of possible actions to reach some predefined goal or solution.
Problem-solving methods are categorized as special purpose and general
purpose.
• • A special-purpose method is tailor-made for a particular problem, often
exploits very specific features of the situation in which the problem is
embedded.
• • A general-purpose method is applicable to a wide variety of problems.
One General-purpose technique used in AI is ‘means-end analysis’: a
step-bystep, or incremental, reduction of the difference between current
state and final goal.
Example – Toy Problems
Vacuum Cleaner World
Program implements the agent function tabulated
89
Toy Problem- 1
Vacuum Cleaner World -Problem Formulation
• Initial State
– Any one of 8 states
• Actions
– In this simple environment, each state has just three actions: Left , Right ,Suck.
Larger environments might also include Up , Down
Toy Problem- 1
Vacuum Cleaner World -Problem Formulation
• Transition model: The actions have their expected effects, except that
moving Left in the leftmost square, moving Right in the rightmost square,
and Sucking in a clean square have no effect. The complete state space is
shown in the figure .
• Goal Test
– This checks whether all the squares are clean
• Path Cost
– Number of steps (each step costs a value of 1)
Toy Problem- 2
The 8-Puzzle (Sliding Block Puzzle)
Successor function: This generates the legal states that result from
trying the four actions (blank moves Left, Right, Up, or Down).
Goal test: This checks whether the state matches the goal
configuration (Other goal configurations are possible.)
Path cost: Each step costs 1, so the path cost is the number of steps
in the path.
Toy Problem- 2
The 8-Puzzle (Sliding Block Puzzle) - Solution
• hf= +1 for every correct position
• Solution of this problem is “movement of tiles” in order to reach
goal state.
• The transition function or legal move is any one tile movement
by one space in any direction.
Toy Problem- 2
The 8-Puzzle (Sliding Block Puzzle) - Solution
Toy Problem- 2
The 8-Puzzle (Sliding Block Puzzle) - Solution
Toy Problem- 3
Water – Jug Problem
Where,
Note
0 ≤ X ≤ 4, and 0 ≤ Y ≤ 3
First solution
1. (x,y) -> (4,y) Fill x
2. (x,y) -> (x,3) Fill y
3. (x,y) -> (x-d, y) Pour water out from X
4. (x,y) -> (x,y-d) Pour water from y
Initial
5. (x,y) -> (0,y) Empty x
R2 6. (x,y) -> (x,0) Empty y
R9 7. (x,y) -> (4,y-(4-x)) Pour water from y into x until
R2 x is full
8. (x,y) -> (x – (3-y), 3) Pour water from x into y until
R7
y is full.
R5 9. (x,y) -> (x+y, 0) Pour all water from y to x
R9 10. (x,y) -> (0, x+y) Pour all water from x to y
11. (0,2) -> (2,0) Pour 2 Gallon of water from y to x
12. (2, y) -> (0,y) Pour 2 Gallon of water from x to
ground.
Toy Problem- 4(a)
4-queens problem
In figure , the possible board configuration for 8-queen problem has been shown. The board
has alternative black and white positions on it. The different positions on the board hold the
queens. The production rule for this game is you cannot put the same queens in a same row
or same column or in same diagonal. After shifting a single queen from its position on the
board, the user have to shift other queens according to the production rule. Starting from the
first row on the board the queen of their corresponding row and column are to be moved
from their original positions to another position. Finally the player has to be ensured that no
rows or columns or diagonals of on the table is same.
Toy Problem- 4(b)
8-queens problem
The first incremental formulation one might try is the following:
• States: Any arrangement of 0 to 8 queens on the board is a
state.
• Initial state: No queens on the board.
• Actions/Successor function : Add a queen to any empty
square.
• Transition model: Returns the board with a queen added to the
specified square.
• Goal test: 8 queens are on the board, none attacked.
• Path cost: Zero (search cost only exists)
In this formulation, we have 64 ・ 63 ・ ・ ・ 57 ≈ 1.8×1014 possible sequences to
investigate.
Toy Problem- 5
BLOCK WORLD
What is the Blocks World? -- The world consists of:
•A flat surface such as a tabletop
•An adequate set of identical blocks which are identified by
letters.
•The blocks can be stacked one on one to form towers of
apparently unlimited height.
•The stacking is achieved using a robot arm which has
fundamental operations and states which can be assessed using
logic and combined using logical operations.
•The robot can hold one block at a time and only one block can
be moved at a time.
Toy Problem- 5
Toy Problem- 5
Blocks World Problem – Ex .
hf = -10 hf = +10
Heuristic
Toy Problem- 5
Blocks World Problem – Ex .
Step 1
Toy Problem- 5
Blocks World Problem – Ex .
Step 2
Toy Problem- 5
Blocks World Problem – Ex .
Step 3
hf = -1
Toy Problem- 5
Blocks World Problem – Ex .
Step 4
Toy Problem- 5
Blocks World Problem – Ex .
Step 5
hf = +3
Toy Problem- 5
Blocks World Problem – Ex .
Step 6
hf = +10
Assume ,
So,a player who gets 3 consecutive
Player 1 - X marks first,they will win the game .
Player 2 - O
Toy Problem- 7
Missionaries and Cannibals
Let Missionary is denoted by ‘M’ and Cannibal, by ‘C’.
These rules are described below:
The basic travelling salesperson problem comprises of computing the shortest route
through a given set of cities.
Following Table shows number of cities and the possible routes mentioned
against them.
Toy Problem- 9
Monkey Banana Problem
Monkey standing on the chair and catching the bananas with the stick.
Summary of Problem Solving with AI –
Toy Problems
1. Block World
2. 4 Queens/ 8 Queens
3. Tic Tac Toe
4. Water Jug
5. Monkey Banana
6. 8 Puzzle
7. TSP
8. Vacuum Cleaner
9. Missionaries and Cannibals
Unit 1 List of Topics
• Introduction to AI-AI techniques
• Problem solving with AI •Types of agents
•Other aspects of agents
• AI Models, Data acquisition and
learning aspects in AI •Constraint satisfaction
• Problem solving- Problem solving problems(CSP)
process, Formulating problems •Crypto arithmetic puzzles
What AI
should fill
Intelligent Agents
Intelligent Agent – Is an entity that works without
assistance, interprets the input, senses the
environment, makes choices and ultimately acts to
achieve a goal.
Percept
● Agent’s perceptual inputs at any given instant
Percept sequence
● Complete history of everything that the agent
has ever perceived.
Agents and Environment
• A rational agent is an agent that behaves logically and does the right
things.
• In artificial intelligence and even in other disciplines like economics,
game theory, decision theory, a rational agent is an agent that chooses to
perform an action which leads to an expected optimal result.
• Along with all sensors and actuators, the agent is provided with complete
specifications of the problem and the task to be performed.
• Based on this information, the agent performs the most logical actions.
• Rational actions are those which can make an agent the most successful.
• A rational agent provides or makes rational rather logical decisions.
• Typical examples of rational agent : A person, governing body, decision
authority, firm, machine or software.
What is Ideal Rational Agent?
An ideal rational agent is the one, which is capable of doing expected actions to
maximize its performance measure, on the basis of −
• Its percept sequence
• Its built-in knowledge base
Rationality of an agent depends on the following −
• The performance measures, which determine the degree of success.
• Agent’s Percept Sequence till now.
• The agent’s prior knowledge about the environment.
• The actions that the agent can carry out.
A rational agent always performs right action, where the right action
means the action that causes the agent to be most successful in the
given percept sequence. The problem the agent solves is characterized
by Performance Measure, Environment, Actuators, and Sensors
(PEAS).
Rational Agents
specification
– Example: agent to sort a list of numbers
– Sample table for such an agent
– Lisp code
Unit 1 List of Topics
• Introduction to AI-AI techniques
• Problem solving with AI •Types of agents
•Other aspects of agents
• AI Models, Data acquisition and
learning aspects in AI •Constraint satisfaction
• Problem solving- Problem solving problems(CSP)
process, Formulating problems •Crypto arithmetic puzzles
• Rational agent
● One that does the right thing
● = every entry in the table for the agent
function is correct (rational).
• What is correct?
● The actions that cause the agent to be most
successful
● So we need ways to measure success.
Performance measure
• Performance measure
● An objective function that determines
● How the agent does successfully
● E.g., 90% or 30% ?
• An agent, based on its percepts
● action sequence :
if desirable, it is said to be performing well.
● No universal performance measure for all
agents
Performance measure
• A general rule:
● Design performance measures according to
● What one actually wants in the environment
● Rather than how one thinks the agent should
behave
• E.g., in vacuum-cleaner world
● We want the floor clean, no matter how the
agent behave
● We don’t restrict how the agent behaves
Example of a rational agent
• Performance measure
● Awards one point for each clean square
● at each time step, over 10000 time steps
• Prior knowledge about the environment
● The geography of the environment
● Only two squares
● The effect of the actions
Example of a rational agent
• An omniscient agent
● Knows the actual outcome of its actions in
advance
● No other possible outcomes
● However, impossible in real world
• An example
● crossing a street but died of the fallen
cargo door from 33,000ft irrational?
Omniscience
• What is an agent ?
● An agent is anything that perceiving its
environment through sensors and acting upon
that environment through actuators
● Example:
● Human is an agent
● A robot is also an agent with cameras and motors
● A thermostat detecting room temperature.
Intelligent Agents
Diagram of an agent
• Percept
● Agent’s perceptual inputs at any given instant
• Percept sequence
● Complete history of everything that the agent has
ever perceived.
Agent function & program
• Performance measure
● How can we judge the automated driver?
● Which factors are considered?
● getting to the correct destination
● minimizing fuel consumption
● minimizing the trip time and/or cost
● minimizing the violations of traffic laws
● maximizing the safety and comfort, etc.
Task environments
• Environment
● A taxi must deal with a variety of roads
● Traffic lights, other vehicles, pedestrians,
stray animals, road works, police cars, etc.
● Interact with the customer
Task environments
• Partially observable
An environment might be Partially observable
because of noisy and inaccurate sensors or
because parts of the state are simply missing
from the sensor data.
Example:
● A local dirt sensor of the cleaner cannot tell
● Whether other squares are clean or not
Properties of task environments
• Four types
● Simple reflex agents
● Model-based reflex agents
● Goal-based agents
● Utility-based agents
Simple reflex agents
percepts
(size, motion)
RULES:
(1) If small moving object,
then activate SNAP
(2) If large moving object,
then activate AVOID and inhibit SNAP
ELSE (not moving) then NOOP
needed for
completeness Action: SNAP or AVOID or
Model-based Reflex Agents
IF THEN
Saw an object ahead, Go straight
and turned right, and
it’s now clear ahead
Saw an object Ahead, Halt
turned right, and object
ahead again
See no objects ahead Go straight
start
• Conclusion
● Goal-based agents are less efficient
● but more flexible
● Agent Different goals different tasks
● Search and planning
● two other sub-fields in AI
● to find out the action sequences to achieve its goal
Goal-based agents
Utility-based agents
• CSP:
– state is defined by variables Xi with values from domain Di
– goal test is a set of constraints specifying allowable combinations of
values for subsets of variables
209
Unit 1 List of Topics
•Flexibility and Intelligent agents
• Introduction to AI-AI techniques •Task environment and its
properties
• Problem solving with AI
•Types of agents
• AI Models, Data acquisition and •Other aspects of agents
learning aspects in AI
• Problem solving- Problem solving •Constraint satisfaction
process, Formulating problems problems(CSP)
•Crypto arithmetic puzzles
• Domains Di = {red,green,blue}
212
Constraint graph
213
Varieties of CSPs
• Discrete variables
– finite domains:
• n variables, domain size d O(d n) complete assignments
• e.g., 3-SAT (NP-complete)
– infinite domains:
• integers, strings, etc.
• e.g., job scheduling, variables are start/end days for each job
• need a constraint language, e.g., StartJob1 + 5 ≤ StartJob3
• Continuous variables
– e.g., start/end times for Hubble Space Telescope observations
– linear constraints solvable in polynomial time by linear programming
214
Varieties of constraints
215
Unit 1 List of Topics
•Flexibility and Intelligent agents
• Introduction to AI-AI techniques •Task environment and its
properties
• Problem solving with AI
•Types of agents
• AI Models, Data acquisition and •Other aspects of agents
learning aspects in AI
• Problem solving- Problem solving •Constraint satisfaction
process, Formulating problems problems(CSP)
•Crypto arithmetic puzzles
• SEND+MORE = MONEY
• Initial State: no variable has a value
• Operators:
– assign a variable a digit (0..9) (no dups)
– unassign a variable
• Goal: arithmetic statement is true.
• Example of Constraint Satisfaction Problem
Cryptarithmetic , An example
Rule 1 : 0 to 9
Rule 2: 1 Letter no 2 nos
1 no no 2 letters
Rule 3: maximum carry over is one
M = Need a carry 1 NC
Possibility 1
M=1
S E N D
4th column:
O:
10, 12 to 19
1
NC : No CARRY M O N E Y
1
Assume S = 9:
W/O Carry:
S + M = 10 + O
1 NC
9 + 1 = 10
With Carry:
C+S+ M = 10 + O
S E N D
1+ 9 + 1 = 10 + O
-------------------------------
Assume S = 8:
w/o Carry : M O R E
8+ 1 = 10 + O
1 0
With Carry:
1+8+1 = 10 + O M O N E Y
1 0
3rd Column:
w/o carry:
E+O=N
E + 0 = N (Any number + 0 = same num) 1 1 NC
So this not allowed because both N and O
Will get same number) S E N D
With Carry:
C+ E + O = N
M O R E
1+ E + 0 = N
1+ E = N ------ Eq. 1
1 0
M O N E Y
1 0
2nd
Column:
With Carry:
C+N+R = 10+E
1+N+R = 10+ E ------- Eq.2
Sub Eq.1 in eq. 2
1+1+E+R = 10 +E
R=8 1 NC 1 NC
Without Carry:
N+R = 10+E S E N D
1+E +R = 10+E
R=9
D + E = 10 + Y
10
11 1 NC 1 1 NC
12 3+9, 4+8, 5+7
13 1+12, 2+11, 3+10, 4+9, 5+8, 6+7
14
S E N D
15
16
9 5 6 7
17
18 M O R E
19
All other combinations will be ruled out since its 1 0 8 5
not satisfying constraints. So finally we will get
5+7 M O N E Y
6 +7
1 0 6 5 2
1st
column:
D + E = 10 + Y
Two possibilities : 5+7, 6 +7
Common number : 7
Now we want to check, value 7 should be assigned
to either D or E.
1 NC 1 1 NC
If we take E = 7, in 3rd column we will get
1+7+0 = 8 (But 8 already allotted to R) S E N D
So D =7 is fixed.
• Variables: F T U W R O X 1 X 2 X3
• Domains: {0,1,2,3,4,5,6,7,8,9} {0,1}
• Constraints: Alldiff (F,T,U,W,R,O)
– O + O = R + 10 · X1
– X1 + W + W = U + 10 · X2
– X2 + T + T = O + 10 · X3
– X3 = F, T ≠ 0, F ≠ 0
225
Real-world CSPs
226
Unit 1 List of Topics
•Flexibility and Intelligent agents
• Introduction to AI-AI techniques •Task environment and its
properties
• Problem solving with AI
•Types of agents
• AI Models, Data acquisition and •Other aspects of agents
learning aspects in AI
• Problem solving- Problem solving •Constraint satisfaction
process, Formulating problems problems(CSP)
•Crypto arithmetic puzzles
S E N D
9 5 6 7
M O R E
1 0 8 5
M O N E Y
1 0 6 5 2
Unit - 2
Searching Techniques
17-03-2021 18CSC305J_AI_UNIT3 1
Knowledge and Reasoning
Table of Contents
• Knowledge and reasoning-Approaches and issues of knowledge reasoning-Knowledge
base agents
• Logic Basics-Logic-Propositional logic-syntax ,semantics and inferences-Propositional
logic- Reasoning patterns
• Unification and Resolution-Knowledge representation using rules-Knowledge
representation using semantic nets
• Knowledge representation using frames-Inferences-
• Uncertain Knowledge and reasoning-Methods-Bayesian probability and belief network
• Probabilistic reasoning-Probabilistic reasoning over time-Probabilistic reasoning over time
• Other uncertain techniques-Data mining-Fuzzy logic-Dempster -shafer theory
17-03-2021 18CSC305J_AI_UNIT3 2
Knowledge Representation & Reasoning
• The second most important concept in AI
• If we are going to act rationally in our environment, then we must have some way of
describing that environment and drawing inferences from that representation.
• how do we describe what we know about the world ?
• how do we describe it concisely ?
• how do we describe it so that we can get hold of the right piece of knowledge when
we need it ?
• how do we generate new pieces of knowledge ?
• how do we deal with uncertain knowledge ?
Knowledge Representation & Reasoning
Knowledge
Declarative Procedural
• Declarative knowledge deals with factoid questions (what is the capital of
India? Etc.)
• Procedural knowledge deals with “How”
• Procedural knowledge can be embedded in declarative knowledge
Planning
Given a set of goals, construct a sequence of actions that achieves
those goals:
• often very large search space
• but most parts of the world are independent of most other
parts
• often start with goals and connect them to actions
• no necessary connection between order of planning and order
of execution
• what happens if the world changes as we execute the plan
and/or our actions don’t produce the expected results?
Learning
12
17-03-2021 18CSC305J_AI_UNIT3
Requirements for a Knowledge-Based Agent
1. \what it already knows" [McCarthy '59]
A knowledge base of beliefs.
2. \it must rst be capable of being told" [McCarthy '59]
A way to put new beliefs into the knowledge base.
3. \automatically deduces for itself a suciently wide class of
immediate consequences" [McCarthy '59]
A reasoning mechanism to derive new beliefs from ones already
in the knowledge base.
17-03-2021 18CSC305J_AI_UNIT3 13
ARCHITECTURE OF A KNOWLEDGE-BASED
AGENT
• Knowledge Level.
• The most abstract level: describe agent by saying what it knows.
• Example: A taxi agent might know that the Golden Gate Bridge connects San
Francisco with the Marin County.
• Logical Level.
• The level at which the knowledge is encoded into sentences.
• Example: Links(GoldenGateBridge, SanFrancisco, MarinCounty).
• Implementation Level.
• The physical representation of the sentences in the logical level.
• Example: ‘(links goldengatebridge sanfrancisco marincounty)
14
17-03-2021 18CSC305J_AI_UNIT3
THE WUMPUS WORLD ENVIRONMENT
• The Wumpus computer game
• The agent explores a cave consisting of rooms connected by passageways.
• Lurking somewhere in the cave is the Wumpus, a beast that eats any agent that
enters its room.
• Some rooms contain bottomless pits that trap any agent that wanders into the
room.
• Occasionally, there is a heap of gold in a room.
• The goal is to collect the gold and exit the world without being eaten
15
17-03-2021 18CSC305J_AI_UNIT3
A TYPICAL WUMPUS WORLD
• The agent always starts in the
field [1,1].
• The task of the agent is to
find the gold, return to the
field [1,1] and climb out of
the cave.
17-03-2021
16 18CSC305J_AI_UNIT3
AGENT IN A WUMPUS WORLD: PERCEPTS
• The agent perceives
• a stench in the square containing the Wumpus and in the adjacent squares (not
diagonally)
• a breeze in the squares adjacent to a pit
• a glitter in the square where the gold is
• a bump, if it walks into a wall
• a woeful scream everywhere in the cave, if the wumpus is killed
• The percepts are given as a five-symbol list. If there is a stench and a breeze, but no
glitter, no bump, and no scream, the percept is
[Stench, Breeze, None, None, None]
17
17-03-2021 18CSC305J_AI_UNIT3
WUMPUS WORLD ACTIONS
• go forward
• turn right 90 degrees
• turn left 90 degrees
• grab: Pick up an object that is in the same square as the agent
• shoot: Fire an arrow in a straight line in the direction the agent is facing. The arrow
continues until it either hits and kills the wumpus or hits the outer wall. The agent
has only one arrow, so only the first Shoot action has any effect
• climb is used to leave the cave. This action is only effective in the start square
• die: This action automatically and irretrievably happens if the agent enters a square
with a pit or a live wumpus
18
17-03-2021 18CSC305J_AI_UNIT3
ILLUSTRATIVE EXAMPLE: WUMPUS WORLD
•Performance measure
• gold +1000,
• death -1000
(falling into a pit or being eaten by the wumpus)
• -1 per step, -10 for using the arrow
•Environment
• Rooms / squares connected by doors.
• Squares adjacent to wumpus are smelly
• Squares adjacent to pit are breezy
• Glitter iff gold is in the same square
• Shooting kills wumpus if you are facing it
• Shooting uses up the only arrow
• Grabbing picks up gold if in same square
• Releasing drops the gold in same square
• Randomly generated at start of game. Wumpus only senses current room.
•Sensors: Stench, Breeze, Glitter, Bump, Scream [perceptual inputs]
•Actuators: Left turn, Right turn, Forward, Grab, Release, Shoot
17-03-2021 18CSC305J_AI_UNIT3 19
WUMPUS WORLD CHARACTERIZATION
Fully Observable No – only local perception
Discrete Yes
17-03-2021 18CSC305J_AI_UNIT3 20
EXPLORING A WUMPUS WORLD
The knowledge base of the agent
consists of the rules of the
Wumpus world plus the percept
“nothing” in [1,1]
Boolean percept
feature values:
<0, 0, 0, 0, 0>
17-03-2021 18CSC305J_AI_UNIT3 21
EXPLORING A WUMPUS WORLD
17-03-2021 18CSC305J_AI_UNIT3 22
EXPLORING A WUMPUS WORLD
T=0 T=1
P?
A/B P?
V
1 2 3 4
Stench, none, none, none, none
17-03-2021 18CSC305J_AI_UNIT3 24
EXPLORING A WUMPUS WORLD
We reasoned about the possible states the Wumpus world can be in,
given our percepts and our knowledge of the rules of the Wumpus
world.
I.e., the content of KB at T=3.
W
What follows is what holds true in all those worlds that satisfy what is
known at that time T=3 about the particular Wumpus world we are in.
P
Example property: P_in_(3,1)
Models(KB) Models(P_in_(3,1)) P
26
17-03-2021 18CSC305J_AI_UNIT3
SUMMARY OF KNOWLEDGE BASED AGENTS
• Intelligent agents need knowledge about the world for making good decisions.
• The knowledge of an agent is stored in a knowledge base in the form of sentences in a
knowledge representation language.
• A knowledge-based agent needs a knowledge base and an inference mechanism. It
operates by storing sentences in its knowledge base, inferring new sentences with the
inference mechanism, and using them to deduce which actions to take.
• A representation language is defined by its syntax and semantics, which specify the
structure of sentences and how they relate to the facts of the world.
• The interpretation of a sentence is the fact to which it refers. If this fact is part of the
actual world, then the sentence is true.
27
17-03-2021 18CSC305J_AI_UNIT3
Knowledge and Reasoning
Table of Contents
• Knowledge and reasoning-Approaches and issues of knowledge reasoning-Knowledge base
agents
• Logic Basics-Logic-Propositional logic-syntax ,semantics and inferences-Propositional logic-
Reasoning patterns
• Unification and Resolution-Knowledge representation using rules-Knowledge representation
using semantic nets
• Knowledge representation using frames-Inferences-
• Uncertain Knowledge and reasoning-Methods-Bayesian probability and belief network
• Probabilistic reasoning-Probabilistic reasoning over time-Probabilistic reasoning over time
• Other uncertain techniques-Data mining-Fuzzy logic-Dempster -shafer theory
17-03-2021 18CSC305J_AI_UNIT3 28
What is a Logic?
• A language with concrete rules
• No ambiguity in representation (may be other errors!)
• Allows unambiguous communication and processing
• Very unlike natural languages e.g. English
• Many ways to translate between languages
• A statement can be represented in different logics
• And perhaps differently in same logic
• Expressiveness of a logic
• How much can we say in this language?
• Not to be confused with logical reasoning
• Logics are languages, reasoning is a process (may use logic)
18CSC305J_AI_UNIT3 29
17-03-2021
Syntax and Semantics
• Syntax
• Rules for constructing legal sentences in the logic
• Which symbols we can use (English: letters, punctuation)
• How we are allowed to combine symbols
• Semantics
• How we interpret (read) sentences in the logic
• Assigns a meaning to each sentence
• Example: “All lecturers are seven foot tall”
• A valid sentence (syntax)
• And we can understand the meaning (semantics)
• This sentence happens to be false (there is a counterexample)
Propositional Logic
• Syntax
• Propositions, e.g. “it is wet”
• Connectives: and, or, not, implies, iff (equivalent)
• For all X
• if (X is a rose)
• then there exists Y
• (X has Y) and (Y is a thorn)
Example: FOL Sentence
• “On Mondays and Wednesdays I go to John’s house for dinner”
40
17-03-2021 18CSC305J_AI_UNIT3
Truth tables
• Logic, like arithmetic, has operators, which apply to one, two, or more
values (operands)
• A truth table lists the results for each possible arrangement of operands
• Order is important: x op y may or may not give the same result as y op x
• The rows in a truth table list all possible sequences of truth values for n
operands, and specify a result for each sequence
• Hence, there are 2n rows in a truth table for n operands
41
17-03-2021 18CSC305J_AI_UNIT3
Unary operators
• There are four possible unary operators:
X Identity, (X)
X Constant true, (T) T T
T T F F
F T
X Negation, ¬X
X Constant false, (F)
T F
T F
F T
F F
• Only the last of these (negation) is widely used (and has a symbol,¬ ,for the operation
42
17-03-2021 18CSC305J_AI_UNIT3
Combined tables for unary operators
43
Binary operators
• There are sixteen possible binary operators:
X Y
T T T T T T T T T T F F F F F F F F
T F T T T T F F F F T T T T F F F F
F T T T F F T T F F T T F F T T F F
F F T F T F T F T F T F T F T F T F
• All these operators have names, but I haven’t tried to fit them in
• Only a few of these operators are normally used in logic
44
17-03-2021 18CSC305J_AI_UNIT3
Useful binary operators
• Here are the binary operators that are traditionally used:
• Notice in particular that material implication () only approximately means the same as the
English word “implies”
• All the other operators can be constructed from a combination of these (along with unary
not,
45
¬)
17-03-2021 18CSC305J_AI_UNIT3
Logical expressions
• All logical expressions can be computed with some combination of and (),
or (), and not () operators
• For example, logical implication can be computed this way:
X Y X X Y XY
T T F T T
T F F F F
F T T T T
F F T T T
• Notice that X Y is equivalent to X Y
46
17-03-2021 18CSC305J_AI_UNIT3
Another example
• Exclusive or (xor) is true if exactly one of its operands is true
X Y X Y X Y X Y (XY)(XY) X xor Y
T T F F F F F F
T F F T F T T T
F T T F T F T T
F F T T F F F F
47
17-03-2021 18CSC305J_AI_UNIT3
World
• A world is a collection of prepositions and logical expressions relating those
prepositions
• Example:
• Propositions: JohnLovesMary, MaryIsFemale, MaryIsRich
• Expressions:
MaryIsFemale MaryIsRich JohnLovesMary
• A proposition “says something” about the world, but since it is atomic (you
can’t look inside it to see component parts), propositions tend to be very
specialized and inflexible
48
17-03-2021 18CSC305J_AI_UNIT3
Models
A model is an assignment of a truth value to each proposition, for example:
• JohnLovesMary: T, MaryIsFemale: T, MaryIsRich: F
• An expression is satisfiable if there is a model for which the expression is true
• For example, the above model satisfies the expression
MaryIsFemale MaryIsRich JohnLovesMary
• An expression is valid if it is satisfied by every model
• This expression is not valid:
MaryIsFemale MaryIsRich JohnLovesMary
because it is not satisfied by this model:
JohnLovesMary: F, MaryIsFemale: T, MaryIsRich: T
• But this expression is valid:
MaryIsFemale MaryIsRich MaryIsFemale
49
17-03-2021 18CSC305J_AI_UNIT3
Inference rules in propositional logic
• Here are just a few of the rules you can apply when reasoning in propositional logic:
50
17-03-2021 18CSC305J_AI_UNIT3
Implication elimination
• A particularly important rule allows you to get rid of
the implication operator, :
• X Y X Y
• We will use this later on as a necessary tool for
simplifying logical expressions
• The symbol means “is logically equivalent to”
51
17-03-2021 18CSC305J_AI_UNIT3
Conjunction elimination
• Another important rule for simplifying logical expressions
allows you to get rid of the conjunction (and) operator, :
• This rule simply says that if you have an and operator at the
top level of a fact (logical expression), you can break the
expression up into two separate facts:
• MaryIsFemale MaryIsRich
• becomes:
• MaryIsFemale
• MaryIsRich
52
17-03-2021 18CSC305J_AI_UNIT3
Inference by computer
• To do inference (reasoning) by computer is basically a search process,
taking logical expressions and applying inference rules to them
• Which logical expressions to use?
• Which inference rules to apply?
• Usually you are trying to “prove” some particular statement
• Example:
• it_is_raining it_is_sunny
• it_is_sunny I_stay_dry
• it_is_rainy I_take_umbrella
• I_take_umbrella I_stay_dry
53• To prove: I_stay_dry
17-03-2021 18CSC305J_AI_UNIT3
Knowledge and Reasoning
Table of Contents
• Knowledge and reasoning-Approaches and issues of knowledge reasoning-
Knowledge base agents
• Logic Basics-Logic-Propositional logic-syntax ,semantics and inferences-
Propositional logic- Reasoning patterns
• Unification and Resolution-Knowledge representation using rules-Knowledge
representation using semantic nets
• Knowledge representation using frames-Inferences-
• Uncertain Knowledge and reasoning-Methods-Bayesian probability and belief
network
• Probabilistic reasoning-Probabilistic reasoning over time-Probabilistic
reasoning over time
• Other uncertain techniques-Data mining-Fuzzy logic-Dempster -shafer theory
17-03-2021 18CSC305J_AI_UNIT3 54
Reasoning Patterns
• Inference in propositional logic is NP-complete!
• However, inference in propositional logic shows
monoticity:
• Adding more rules to a knowledge base does not
affect earlier inferences
Forward and backward reasoning
• Situation: You have a collection of logical expressions (premises), and
you are trying to prove some additional logical expression (the
conclusion)
• You can:
• Do forward reasoning: Start applying inference rules to the logical
expressions you have, and stop if one of your results is the
conclusion you want
• Do backward reasoning: Start from the conclusion you want, and
try to choose inference rules that will get you back to the logical
expressions you have
• With the tools we have discussed so far, neither is feasible
56
17-03-2021 18CSC305J_AI_UNIT3
Example
• Given:
• it_is_raining it_is_sunny
• it_is_sunny I_stay_dry
• it_is_raining I_take_umbrella
• I_take_umbrella I_stay_dry
• You can conclude:
• it_is_sunny it_is_raining
• I_take_umbrella it_is_sunny
• I_stay_dry I_take_umbrella
• Etc., etc. ... there are just too many things you can conclude!
57
17-03-2021 18CSC305J_AI_UNIT3
Predicate calculus
• Predicate calculus is also known as “First Order Logic” (FOL)
• Predicate calculus includes:
• All of propositional logic
• Logical values true, false
• Variables x, y, a, b,...
• Connectives , , , ,
• Constants KingJohn, 2, Villanova,...
• Predicates Brother, >,...
• Functions Sqrt, MotherOf,...
• Quantifiers ,
58
17-03-2021 18CSC305J_AI_UNIT3
Constants, functions, and predicates
• A constant represents a “thing”--it has no truth value, and it
does not occur “bare” in a logical expression
• Examples: DavidMatuszek, 5, Earth, goodIdea
• Given zero or more arguments, a function produces a
constant as its value:
• Examples: motherOf(DavidMatuszek), add(2, 2),
thisPlanet()
• A predicate is like a function, but produces a truth value
• Examples: greatInstructor(DavidMatuszek),
59 isPlanet(Earth), greater(3, add(2, 2))
17-03-2021 18CSC305J_AI_UNIT3
Universal quantification
• The universal quantifier, , is read as “for each”
or “for every”
• Example: x, x2 0 (for all x, x2 is greater than or equal to zero)
• Typically, is the main connective with :
x, at(x,Villanova) smart(x)
means “Everyone at Villanova is smart”
• Common mistake: using as the main connective with :
x, at(x,Villanova) smart(x)
means “Everyone is at Villanova and everyone is smart”
• If there are no values satisfying the condition, the result is true
• Example: x, isPersonFromMars(x) smart(x) is true
60
17-03-2021 18CSC305J_AI_UNIT3
Existential quantification
• The existential quantifier, , is read “for some” or “there exists”
• Example: x, x2 < 0 (there exists an x such that x2 is less than zero)
• Typically, is the main connective with :
x, at(x,Villanova) smart(x)
means “There is someone who is at Villanova and is smart”
• Common mistake: using as the main connective with :
x, at(x,Villanova) smart(x)
This is true if there is someone at Villanova who is smart...
...but it is also true if there is someone who is not at Villanova
By the rules of material implication, the result of F T is T
61
17-03-2021 18CSC305J_AI_UNIT3
Properties of quantifiers
• x y is the same as y x
• x y is the same as y x
62
17-03-2021 18CSC305J_AI_UNIT3
Parentheses
• Parentheses are often used with quantifiers
• Unfortunately, everyone uses them differently, so don’t be upset at any
usage you see
• Examples:
• (x) person(x) likes(x,iceCream)
• (x) (person(x) likes(x,iceCream))
• (x) [ person(x) likes(x,iceCream) ]
• x, person(x) likes(x,iceCream)
• x (person(x) likes(x,iceCream))
• I prefer parentheses that show the scope of the quantifier
• x (x > 0) x (x < 0)
63
17-03-2021 18CSC305J_AI_UNIT3
More rules
• Now there are numerous additional rules we can apply!
• Here are two exceptionally important rules:
• x, p(x) x, p(x)
“If not every x satisfies p(x), then there exists a x that does not satisfy
p(x)”
• x, p(x) x, p(x)
“If there does not exist an x that satisfies p(x), then all x do not satisfy
p(x)”
• In any case, the search space is just too large to be feasible
• This was the case until 1970, when J. Robinson discovered resolution
64
17-03-2021 18CSC305J_AI_UNIT3
Knowledge and Reasoning
Table of Contents
• Knowledge and reasoning-Approaches and issues of knowledge reasoning-
Knowledge base agents
• Logic Basics-Logic-Propositional logic-syntax ,semantics and inferences-
Propositional logic- Reasoning patterns
• Unification and Resolution-Knowledge representation using rules-Knowledge
representation using semantic nets
• Knowledge representation using frames-Inferences-
• Uncertain Knowledge and reasoning-Methods-Bayesian probability and belief
network
• Probabilistic reasoning-Probabilistic reasoning over time-Probabilistic
reasoning over time
• Other uncertain techniques-Data mining-Fuzzy logic-Dempster -shafer theory
17-03-2021 18CSC305J_AI_UNIT3 65
Logic by computer was infeasible
• Why is logic so hard?
• You start with a large collection of facts (predicates)
• You start with a large collection of possible transformations (rules)
• Some of these rules apply to a single fact to yield a new fact
• Some of these rules apply to a pair of facts to yield a new fact
• So at every step you must:
• Choose some rule to apply
• Choose one or two facts to which you might be able to apply the rule
• If there are n facts
• There are n potential ways to apply a single-operand rule
• There are n * (n - 1) potential ways to apply a two-operand rule
• Add the new fact to your ever-expanding fact base
66
17-03-2021 18CSC305J_AI_UNIT3
• The search space is huge!
The magic of resolution
• Here’s how resolution works:
• You transform each of your facts into a particular form, called a clause
(this is the tricky part)
• You apply a single rule, the resolution principle, to a pair of clauses
• Clauses are closed with respect to resolution--that is, when you
resolve two clauses, you get a new clause
• You add the new clause to your fact base
• So the number of facts you have grows linearly
• You still have to choose a pair of facts to resolve
• You never have to choose a rule, because there’s only one
67
17-03-2021 18CSC305J_AI_UNIT3
The fact base
• A fact base is a collection of “facts,” expressed in predicate calculus, that are presumed to be true (valid)
• These facts are implicitly “anded” together
• Example fact base:
• seafood(X) likes(John, X) (where X is a variable)
• seafood(shrimp)
• pasta(X) likes(Mary, X) (where X is a different variable)
• pasta(spaghetti)
• That is,
• (seafood(X) likes(John, X)) seafood(shrimp)
(pasta(Y) likes(Mary, Y)) pasta(spaghetti)
• Notice that we had to change some Xs to Ys
• The scope of a variable is the single fact in which it occurs
68
17-03-2021 18CSC305J_AI_UNIT3
Clause form
• A clause is a disjunction ("or") of zero or more literals, some or all of
which may be negated
• Example:
sinks(X) dissolves(X, water) ¬denser(X, water)
• Notice that clauses use only “or” and “not”—they do not use “and,”
“implies,” or either of the quantifiers “for all” or “there exists”
• The impressive part is that any predicate calculus expression can be
put into clause form
• Existential quantifiers, , are the trickiest ones
69
17-03-2021 18CSC305J_AI_UNIT3
Unification
• From the pair of facts (not yet clauses, just facts):
• seafood(X) likes(John, X) (where X is a variable)
• seafood(shrimp)
• We ought to be able to conclude
• likes(John, shrimp)
• We can do this by unifying the variable X with the constant shrimp
• This is the same “unification” as is done in Prolog
• This unification turns seafood(X) likes(John, X) into
seafood(shrimp) likes(John, shrimp)
• Together with the given fact seafood(shrimp), the final deductive
70
17-03-2021 18CSC305J_AI_UNIT3
step is easy
The resolution principle
• Here it is:
• From X someLiterals
and X someOtherLiterals
----------------------------------------------
conclude: someLiterals someOtherLiterals
• That’s all there is to it!
• Example:
• broke(Bob) well-fed(Bob)
¬broke(Bob) ¬hungry(Bob)
--------------------------------------
well-fed(Bob) ¬hungry(Bob)
71
17-03-2021 18CSC305J_AI_UNIT3
A common error
• You can only do one resolution at a time
• Example:
• broke(Bob) well-fed(Bob) happy(Bob)
¬broke(Bob) ¬hungry(Bob) ∨ ¬happy(Bob)
• You can resolve on broke to get:
• well-fed(Bob) happy(Bob) ¬hungry(Bob) ¬happy(Bob) T
• Or you can resolve on happy to get:
• broke(Bob) well-fed(Bob) ¬broke(Bob) ¬hungry(Bob) T
• Note that both legal resolutions yield a tautology (a trivially true statement, containing X
¬X), which is correct but useless
• But you cannot resolve on both at once to get:
• well-fed(Bob) ¬hungry(Bob)
72
17-03-2021 18CSC305J_AI_UNIT3
Contradiction
• A special case occurs when the result of a resolution (the resolvent) is
empty, or “NIL”
• Example:
• hungry(Bob)
¬hungry(Bob)
----------------
NIL
• In this case, the fact base is inconsistent
• This will turn out to be a very useful observation in doing resolution
theorem proving
73
17-03-2021 18CSC305J_AI_UNIT3
A first example
• “Everywhere that John goes, Rover goes. John is at school.”
• at(John, X) at(Rover, X) (not yet in clause form)
• at(John, school) (already in clause form)
• We use implication elimination to change the first of these into clause
form:
• at(John, X) at(Rover, X)
• at(John, school)
• We can resolve these on at(-, -), but to do so we have to unify X with
school; this gives:
• at(Rover, school)
74
17-03-2021 18CSC305J_AI_UNIT3
Refutation resolution
• The previous example was easy because it had very few clauses
• When we have a lot of clauses, we want to focus our search on the
thing we would like to prove
• We can do this as follows:
• Assume that our fact base is consistent (we can’t derive NIL)
• Add the negation of the thing we want to prove to the fact base
• Show that the fact base is now inconsistent
• Conclude the thing we want to prove
75
17-03-2021 18CSC305J_AI_UNIT3
Example of refutation resolution
• “Everywhere that John goes, Rover goes. John is at school. Prove that Rover is
at school.”
1. at(John, X) at(Rover, X)
2. at(John, school)
3. at(Rover, school) (this is the added clause)
• Resolve #1 and #3:
4. at(John, X)
• Resolve #2 and #4:
5. NIL
• Conclude the negation of the added clause: at(Rover, school)
• This seems a roundabout approach for such a simple example, but it works well
for larger problems
76
17-03-2021 18CSC305J_AI_UNIT3
A second example
• Start with:
• it_is_raining it_is_sunny
• it_is_sunny I_stay_dry
• it_is_raining I_take_umbrella
• I_take_umbrella I_stay_dry
• Proof:
• Convert to clause form:
6. (5, 2) it_is_sunny
1. it_is_raining it_is_sunny
2. it_is_sunny I_stay_dry 7. (6, 1) it_is_raining
3. it_is_raining I_take_umbrella 8. (5, 4) I_take_umbrella
4. I_take_umbrella I_stay_dry 9. (8, 3) it_is_raining
• Prove that I stay dry: 10. (9, 7) NIL
5. I_stay_dry Therefore, (I_stay_dry)
I_stay_dry
77
17-03-2021 18CSC305J_AI_UNIT3
Converting sentences to CNF
1. Eliminate all ↔ connectives
(P ↔ Q) ((P Q) ^ (Q P))
2. Eliminate all connectives
(P Q) (P Q)
3. Reduce the scope of each negation symbol to a single predicate
P P
(P Q) P Q
(P Q) P Q
(x)P (x)P
(x)P (x)P
4. Standardize variables: rename all variables so that each quantifier has its own
unique variable name
78
17-03-2021 18CSC305J_AI_UNIT3
Converting sentences to clausal form Skolem
constants and functions
5. Eliminate existential quantification by introducing Skolem
constants/functions
(x)P(x) P(c)
c is a Skolem constant (a brand-new constant symbol that is not used in any
other sentence)
(x)(y)P(x,y) (x)P(x, f(x))
since is within the scope of a universally quantified variable, use a Skolem
function f to construct a new value that depends on the universally
quantified variable
f must be a brand-new function name not occurring in any other sentence in
the KB.
E.g., (x)(y)loves(x,y) (x)loves(x,f(x))
In this case, f(x) specifies the person that x loves
79
17-03-2021 18CSC305J_AI_UNIT3
Converting sentences to clausal form
6. Remove universal quantifiers by (1) moving them all to the left end;
(2) making the scope of each the entire sentence; and (3) dropping
the “prefix” part
Ex: (x)P(x) P(x)
7. Put into conjunctive normal form (conjunction of disjunctions) using
distributive and associative laws
(P Q) R (P R) (Q R)
(P Q) R (P Q R)
8. Split conjuncts into separate clauses
9. Standardize variables so each clause contains only variable names
that do not occur in any other clause
80
17-03-2021 18CSC305J_AI_UNIT3
An example
(x)(P(x) ((y)(P(y) P(f(x,y))) (y)(Q(x,y) P(y))))
2. Eliminate
(x)(P(x) ((y)(P(y) P(f(x,y))) (y)(Q(x,y) P(y))))
3. Reduce scope of negation
(x)(P(x) ((y)(P(y) P(f(x,y))) (y)(Q(x,y) P(y))))
4. Standardize variables
(x)(P(x) ((y)(P(y) P(f(x,y))) (z)(Q(x,z) P(z))))
5. Eliminate existential quantification
(x)(P(x) ((y)(P(y) P(f(x,y))) (Q(x,g(x)) P(g(x)))))
6. Drop universal quantification symbols
(P(x) ((P(y) P(f(x,y))) (Q(x,g(x)) P(g(x)))))
81
17-03-2021 18CSC305J_AI_UNIT3
Example
7. Convert to conjunction of disjunctions
(P(x) P(y) P(f(x,y))) (P(x) Q(x,g(x)))
(P(x) P(g(x)))
8. Create separate clauses
P(x) P(y) P(f(x,y))
P(x) Q(x,g(x))
P(x) P(g(x))
9. Standardize variables
P(x) P(y) P(f(x,y))
P(z) Q(z,g(z))
P(w) P(g(w))
82
17-03-2021 18CSC305J_AI_UNIT3
Running example
• All Romans who know Marcus either hate Caesar or
think that anyone who hates anyone is crazy
83
17-03-2021 18CSC305J_AI_UNIT3
Step 1: Eliminate implications
• Use the fact that x y is equivalent to x y
84
17-03-2021 18CSC305J_AI_UNIT3
Step 2: Reduce the scope of
• Reduce the scope of negation to a single term, using:
• (p) p
• (a b) (a b)
• (a b) (a b)
• x, p(x) x, p(x)
• x, p(x) x, p(x)
85
17-03-2021 18CSC305J_AI_UNIT3
Step 3: Standardize variables apart
• x, P(x) x, Q(x)
becomes
x, P(x) y, Q(y)
• This is just to keep the scopes of variables from
getting confused
• Not necessary in our running example
86
17-03-2021 18CSC305J_AI_UNIT3
Step 4: Move quantifiers
• Move all quantifiers to the left, without changing their relative
positions
88
17-03-2021 18CSC305J_AI_UNIT3
Step 6: Drop the prefix (quantifiers)
• x, y, z,[ Roman(x) know(x, Marcus) ]
[hate(x, Caesar) (hate(y, z) thinkCrazy(x, y))]
• At this point, all the quantifiers are universal quantifiers
• We can just take it for granted that all variables are
universally quantified
•[ Roman(x) know(x, Marcus) ]
[hate(x, Caesar) (hate(y, z) thinkCrazy(x, y))]
89
17-03-2021 18CSC305J_AI_UNIT3
Step 7: Create a conjunction of disjuncts
becomes
90
17-03-2021 18CSC305J_AI_UNIT3
Step 8: Create separate clauses
• Every place we have an , we break our expression up
into separate pieces
• Not necessary in our running example
91
17-03-2021 18CSC305J_AI_UNIT3
Step 9: Standardize apart
• Rename variables so that no two clauses have the same
variable
• Not necessary in our running example
• Final result:
Roman(x) know(x, Marcus)
hate(x, Caesar) hate(y, z) thinkCrazy(x, y)
93
17-03-2021 18CSC305J_AI_UNIT3
Resolution in first-order logic
• Given sentences
P1 ... Pn
Q1 ... Qm
• in conjunctive normal form:
• each Pi and Qi is a literal, i.e., a positive or negated predicate symbol with its
terms,
• if Pj and Qk unify with substitution list θ, then derive the resolvent sentence:
subst(θ, P1 ... Pj-1 Pj+1 ... Pn Q1 …Qk-1 Qk+1 ... Qm)
• Example
• from clause P(x, f(a)) P(x, f(y)) Q(y)
• and clause P(z, f(a)) Q(z)
• derive resolvent P(z, f(y)) Q(y) Q(z)
• using θ = {x/z}
94
17-03-2021 18CSC305J_AI_UNIT3
Resolution refutation
• Given a consistent set of axioms KB and goal sentence Q, show that KB
|= Q
• Proof by contradiction: Add Q to KB and try to prove false.
i.e., (KB |- Q) ↔ (KB Q |- False)
• Resolution is refutation complete: it can establish that a given sentence
Q is entailed by KB, but can’t (in general) be used to generate all logical
consequences of a set of sentences
• Also, it cannot be used to prove that Q is not entailed by KB.
• Resolution won’t always give an answer since entailment is only
semidecidable
• And you can’t just run two proofs in parallel, one trying to prove Q and the
other trying to prove Q, since KB might not entail either one
96
17-03-2021 18CSC305J_AI_UNIT3
Refutation resolution proof tree
allergies(w) v sneeze(w) cat(y) v ¬allergic-to-cats(z) allergies(z)
w/z
y/Felix
z/Lise
sneeze(Lise) sneeze(Lise)
false
negated query
97
17-03-2021 18CSC305J_AI_UNIT3
We need answers to the following questions
98
17-03-2021 18CSC305J_AI_UNIT3
Unification
• Unification is a “pattern-matching” procedure
• Takes two atomic sentences, called literals, as input
• Returns “Failure” if they do not match and a substitution list, θ, if they do
• That is, unify(p,q) = θ means subst(θ, p) = subst(θ, q) for two atomic
sentences, p and q
• θ is called the most general unifier (mgu)
• All variables in the given two literals are implicitly universally
quantified
• To make literals match, replace (universally quantified) variables by
terms
99
17-03-2021 18CSC305J_AI_UNIT3
Unification algorithm
procedure unify(p, q, θ)
Scan p and q left-to-right and find the first corresponding
terms where p and q “disagree” (i.e., p and q not equal)
If there is no disagreement, return θ (success!)
Let r and s be the terms in p and q, respectively,
where disagreement first occurs
If variable(r) then {
Let θ = union(θ, {r/s})
Return unify(subst(θ, p), subst(θ, q), θ)
} else if variable(s) then {
Let θ = union(θ, {s/r})
Return unify(subst(θ, p), subst(θ, q), θ)
} else return “Failure”
end
100
17-03-2021 18CSC305J_AI_UNIT3
Unification: Remarks
• Unify is a linear-time algorithm that returns the most
general unifier (mgu), i.e., the shortest-length substitution
list that makes the two literals match.
• In general, there is not a unique minimum-length
substitution list, but unify returns one of minimum length
• A variable can never be replaced by a term containing that
variable
Example: x/f(x) is illegal.
• This “occurs check” should be done in the above pseudo-
code before making the recursive calls
101
17-03-2021 18CSC305J_AI_UNIT3
Unification examples
• Example:
• parents(x, father(x), mother(Bill))
• parents(Bill, father(Bill), y)
• {x/Bill, y/mother(Bill)}
• Example:
• parents(x, father(x), mother(Bill))
• parents(Bill, father(y), z)
• {x/Bill, y/Bill, z/mother(Bill)}
• Example:
• parents(x, father(x), mother(Jane))
• parents(Bill, father(y), mother(y))
102 • Failure
17-03-2021 18CSC305J_AI_UNIT3
Resolution example
Practice example : Did Curiosity kill the cat
• Jack owns a dog. Every dog owner is an animal lover. No animal lover
kills an animal. Either Jack or Curiosity killed the cat, who is named
Tuna. Did Curiosity kill the cat?
• These can be represented as follows:
A. (x) Dog(x) Owns(Jack,x)
B. (x) ((y) Dog(y) Owns(x, y)) AnimalLover(x)
C. (x) AnimalLover(x) ((y) Animal(y) Kills(x,y))
D. Kills(Jack,Tuna) Kills(Curiosity,Tuna)
E. Cat(Tuna)
F. (x) Cat(x) Animal(x) GOAL
G. Kills(Curiosity, Tuna)
17-03-2021 18CSC305J_AI_UNIT3
103
• Convert to clause form
D is a skolem constant
A1. (Dog(D))
A2. (Owns(Jack,D))
B. (Dog(y), Owns(x, y), AnimalLover(x))
C. (AnimalLover(a), Animal(b), Kills(a,b))
D. (Kills(Jack,Tuna), Kills(Curiosity,Tuna))
E. Cat(Tuna)
F. (Cat(z), Animal(z))
• Add the negation of query:
G: (Kills(Curiosity, Tuna))
104
17-03-2021 18CSC305J_AI_UNIT3
• The resolution refutation proof
R1: G, D, {} (Kills(Jack, Tuna))
R2: R1, C, {a/Jack, b/Tuna} (~AnimalLover(Jack),
~Animal(Tuna))
R3: R2, B, {x/Jack} (~Dog(y), ~Owns(Jack, y),
~Animal(Tuna))
R4: R3, A1, {y/D} (~Owns(Jack, D),
~Animal(Tuna))
R5: R4, A2, {} (~Animal(Tuna))
R6: R5, F, {z/Tuna} (~Cat(Tuna))
R7: R6, E, {} FALSE
105
17-03-2021 18CSC305J_AI_UNIT3
• The proof tree
G D
{}
R1: K(J,T) C
{a/J,b/T}
R2: AL(J) A(T) B
{x/J}
R3: D(y) O(J,y) A(T) A1
{y/D}
R4: O(J,D), A(T) A2
{}
R5: A(T) F
{z/T}
R6: C(T) A
{}
R7: FALSE
106
17-03-2021 18CSC305J_AI_UNIT3
Knowledge and Reasoning
Table of Contents
• Knowledge and reasoning-Approaches and issues of knowledge reasoning-
Knowledge base agents
• Logic Basics-Logic-Propositional logic-syntax ,semantics and inferences-
Propositional logic- Reasoning patterns
• Unification and Resolution
• Knowledge representation using rules-Knowledge representation using semantic
nets
• Knowledge representation using frames-Inferences-
• Uncertain Knowledge and reasoning-Methods-Bayesian probability and belief
network
• Probabilistic reasoning-Probabilistic reasoning over time-Probabilistic reasoning
over time
• Other uncertain techniques-Data mining-Fuzzy logic-Dempster -shafer theory
17-03-2021 18CSC305J_AI_UNIT3 107
Production Rules
• Condition-Action Pairs
• IF this condition (or premise or antecedent) occurs,
THEN some action (or result, or conclusion, or
consequence) will (or should) occur
• IF the traffic light is red AND you have stopped,
THEN a right turn is OK
Production Rules
• Each production rule in a knowledge base represents an
autonomous chunk of expertise
• When combined and fed to the inference engine, the set of rules
behaves synergistically
• Rules can be viewed as a simulation of the cognitive behaviour
of human experts
• Rules represent a model of actual human behaviour
• Predominant technique used in expert systems, often in
conjunction with frames
Forms of Rules
• IF premise, THEN conclusion
• IF your income is high, THEN your chance of being
audited by the Inland Revenue is high
• Conclusion, IF premise
• Your chance of being audited is high, IF your income
is high
Forms of Rules
• Inclusion of ELSE
• IF your income is high, OR your deductions are unusual, THEN
your chance of being audited is high, OR ELSE your chance of
being audited is low
• More complex rules
• IF credit rating is high AND salary is more than £30,000, OR
assets are more than £75,000, AND pay history is not "poor,"
THEN approve a loan up to £10,000, and list the loan in category
"B.”
• Action part may have more information: THEN "approve the loan"
and "refer to an agent"
Characteristics of Rules
First Part Second Part
Statement AND statements All conditions must be true for a conclusion to be true
C1→A1 Working
Environment
C2→A2 Memory
C3→A3
…
Cn→An
Conflict Conflict
Set Resolution
Recognise-Act Cycle
• Patterns in WM matched against production rule conditions
• Matching (activated) rules form the conflict set
• One of the matching rules is selected (conflict resolution) and
fired
• Action of rule is performed
• Contents of WM updated
• Cycle repeats with updated WM
Conflict Resolution
• Reasoning in a production system can be viewed as a type of
search
• Selection strategy for rules from the conflict set controls
search
• Production system maintains the conflict set as an agenda
• Ordered list of activated rules (those with their conditions
satisfied) which have not yet been executed
• Conflict resolution strategy determines where a newly-
activated rule is inserted
Salience
• Rules may be given a precedence order by assigning a
salience value
• Newly activated rules are placed in the agenda above all rules
of lower salience, and below all rules with higher salience
• Rule with higher salience are executed first
• Conflict resolution strategy applies between rules of the
same salience
• If salience and the conflict resolution strategy can ’ t
determine which rule is to be executed next, a rule is chosen
at random from the most highly ranked rules
Conflict Resolution Strategies
• Depth-first: newly activated rules placed above other rules in the
agenda
• Breadth-first: newly activated rules placed below other rules
• Specificity: rules ordered by the number of conditions in the LHS
(simple-first or complex-first)
• Least recently fired: fire the rule that was last fired the longest time
ago
• Refraction: don’t fire a rule unless the WM patterns that match its
conditions have been modified
• Recency: rules ordered by the timestamps on the facts that match
their conditions
Salience
• Salience facilitates the modularization of expert systems
in which modules work at different levels of abstraction
• Over-use of salience can complicate a system
• Explicit ordering to rule execution
• Makes behaviour of modified systems less predictable
• Rule of thumb: if two rules have the same salience, are
in the same module, and are activated concurrently,
then the order in which they are executed should not
matter
Common Types of Rules
• Knowledge rules, or declarative rules, state all the facts
and relationships about a problem
• Inference rules, or procedural rules, advise on how to
solve a problem, given that certain facts are known
• Inference rules contain rules about rules (metarules)
• Knowledge rules are stored in the knowledge base
• Inference rules become part of the inference engine
Animal Ostrich
Can breathe is-a Runs fast
Can eat Cannot fly
Has skin Is tall
Fish Salmon
is-a Can swim is-a Swims upstream
Has fins Is pink
Has gills Is edible
BEAGLE COLLIE
instance
size: small FICTIONAL
instance CHARACTER instance
instance
SNOOPY instance
LASSIE
friend of
17-03-2021 CHARLIE BROWN
18CSC305J_AI_UNIT3 127
Semantic Networks
What does or should a node represent?
• A class of objects?
• An instance of an class?
• The canonical instance of a class?
• The set of all instances of a class?
DOG COLLIE
Fixed Fixed
legs: 4 breed of: DOG
type: sheepdog
Default
diet: carnivorous Default
sound: bark size: 65cm
Variable Variable
size: colour:
colour:
ELEPHANT
subclass: MAMMAL
colour: grey
size: large
Nellie
instance: ELEPHANT
likes: apples
• elephant(clyde)
∴
mammal(clyde)
has_part(clyde, head)
ELEPHANT
subclass: MAMMAL
has_trunk: yes
*colour: grey
*size: large
*furry: no
Clyde
instance: ELEPHANT
colour: pink
owner: Fred
Nellie
instance: ELEPHANT
size:
17-03-2021 small 18CSC305J_AI_UNIT3 139
Frames (Contd.)
• Can represent subclass and instance relationships (both
sometimes called ISA or “is a”)
• Properties (e.g. colour and size) can be referred to as slots and
slot values (e.g. grey, large) as slot fillers
• Objects can inherit all properties of parent class (therefore
Nellie is grey and large)
• But can inherit properties which are only typical (usually called
default, here starred), and can be overridden
• For example, mammal is typically furry, but this is not so for an
elephant
• Deduction
• Induction
• Abduction
• In real life, it is not always possible to determine the state of the environment as it might not be clear. Due
to partially observable or non-deterministic environments, agents may need to handle uncertainty and deal
with it.
• Uncertain data: Data that is missing, unreliable, inconsistent or noisy
• Uncertain knowledge: When the available knowledge has multiple causes leading to multiple effects or
incomplete knowledge of causality in the domain
• Uncertain knowledge representation: The representations which provides a restricted model of the real
system, or has limited expressiveness
• Inference: In case of incomplete or default reasoning methods, conclusions drawn might not be completely
accurate. Let’s understand this better with the help of an example.
• IF primary infection is bacteria cea
• AND site of infection is sterile
• AND entry point is gastrointestinal tract
• THEN organism is bacteriod (0.7).
• In such uncertain situations, the agent does not guarantee a solution but acts on its own
assumptions and probabilities and gives some degree of belief that it will reach the required
solution.
• For example, In case of Medical diagnosis consider the rule Toothache = Cavity. This
is not complete as not all patients having toothache have cavities. So we can write a
more generalized rule Toothache = Cavity V Gum problems V Abscess… To make this
rule complete, we will have to list all the possible causes of toothache. But this is not
feasible due to the following rules:
• Laziness- It will require a lot of effort to list the complete set of antecedents and
consequents to make the rules complete.
• Theoretical ignorance- Medical science does not have complete theory for the
domain
• Practical ignorance- It might not be practical that all tests have been or can be
conducted for the patients.
• Such uncertain situations can be dealt with using
Probability theory
Truth Maintenance systems
Fuzzy logic.
17-03-2021 18CSC305J_AI_UNIT3 152
Uncertain knowledge and reasoning
Probability
• Probability is the degree of likeliness that an event will occur. It provides a certain degree of belief
in case of uncertain situations. It is defined over a set of events U and assigns value P(e) i.e.
probability of occurrence of event e in the range [0,1]. Here each sentence is labeled with a real
number in the range of 0 to 1, 0 means the sentence is false and 1 means it is true.
• Conditional Probability or Posterior Probability is the probability of event A given that B has
already occurred.
• P(A|B) = (P(B|A) * P(A)) / P(B)
• For example, P(It will rain tomorrow| It is raining today) represents conditional probability of it
raining tomorrow as it is raining today.
• P(A|B) + P(NOT(A)|B) = 1
• Joint probability is the probability of 2 independent events happening simultaneously like rolling
two dice or tossing two coins together. For example, Probability of getting 2 on one dice and 6 on
the other is equal to 1/36. Joint probability has a wide use in various fields such as physics,
astronomy, and comes into play when there are two independent events. The full joint probability
distribution specifies the probability of each complete assignment of values to random variables.
Bayes Theorem
• It is based on the principle that every pair of features being
classified is independent of each other. It calculates probability
P(A|B) where A is class of possible outcomes and B is given
instance which has to be classified.
• P(A|B) = P(B|A) * P(A) / P(B)
• P(A|B) = Probability that A is happening, given that B has
occurred (posterior probability)
• P(A) = prior probability of class
• P(B) = prior probability of predictor
• P(B|A) = likelihood
17-03-2021 18CSC305J_AI_UNIT3 154
Uncertain knowledge and reasoning
CONDITIONAL PROBABILITY
• The Bayesian network has mainly two components:
Causal Component
Actual numbers
• Each node in the Bayesian network has condition probability
distribution P(Xi |Parent(Xi) ), which determines the effect of the
parent on that node.
• Bayesian network is based on Joint probability distribution and
conditional probability. So let's first understand the joint probability
distribution:
Problem:
• Calculate the probability that alarm has sounded, but there is neither a burglary, nor an
earthquake occurred, and David and Sophia both called the Harry.
Solution:
• The Bayesian network for the above problem is given below. The network structure is showing
that burglary and earthquake is the parent node of the alarm and directly affecting the probability
of alarm's going off, but David and Sophia's calls depend on alarm probability.
• The network is representing that our assumptions do not directly perceive the burglary and also
do not notice the minor earthquake, and they also not confer before calling.
• The conditional distributions for each node are given as conditional probabilities table or CPT.
• Each row in the CPT must be sum to 1 because all the entries in the table represent an exhaustive
set of cases for the variable.
• In CPT, a boolean variable with k boolean parents contains 2K probabilities. Hence, if there are
two parents, then CPT will contain 4 probability values
Conditional probability
A P(S= True) P(S= False)
table for Sophia Calls:
The Conditional
True 0.75 0.25
probability of Sophia that
she calls is depending on
False 0.02 0.98
its Parent Node "Alarm."
AP(S= True)P(S=
False)True0.750.25False0.020.98 AP(S=
17-03-2021 18CSC305J_AI_UNIT3
True)P(S=
Bayesian probability and belief network
• From the formula of joint distribution, we can write the problem statement in the form of
probability distribution:
• P(S, D, A, ¬B, ¬E) = P (S|A) *P (D|A)*P (A|¬B ^ ¬E) *P (¬B) *P (¬E).
= 0.75* 0.91* 0.001* 0.998*0.999
= 0.00068045.
Hence, a Bayesian network can answer any query about the domain by using Joint distribution.
• The semantics of Bayesian Network:
• There are two ways to understand the semantics of the Bayesian network, which is given below:
1. To understand the network as the representation of the Joint probability distribution.
• It is helpful to understand how to construct the network.
2. To understand the network as an encoding of a collection of conditional independence
statements.
• It is helpful in designing inference procedure.
Bayes' theorem:
• Bayes' theorem is also known as Bayes' rule, Bayes' law, or Bayesian
reasoning, which determines the probability of an event with uncertain
knowledge.
• In probability theory, it relates the conditional probability and marginal
probabilities of two random events.
• Bayes' theorem was named after the British mathematician Thomas Bayes.
The Bayesian inference is an application of Bayes' theorem, which is
fundamental to Bayesian statistics.
• It is a way to calculate the value of P(B|A) with the knowledge of P(A|B).
• Bayes' theorem allows updating the probability prediction of an event by
observing new information of the real world.
Bayesian Network
When designing a Bayesian Network, we keep
the local probability table at each node.
Bayesian Network - Example
Consider a Bayesian Network as given below:
The updated
Bayesian Network
is:
Fuzzy Input
Fuzzy Output
197
Fuzzification
Establishes the fact base of the fuzzy system. It identifies the input and output of the
system, defines appropriate IF THEN rules, and uses raw data to derive a
membership function.
Consider an air conditioning system that determine the best circulation level by
sampling temperature and moisture levels. The inputs are the current temperature
and moisture level. The fuzzy system outputs the best air circulation level: “none”,
“low”, or “high”. The following fuzzy rules are used:
1. If the room is hot, circulate the air a lot.
2. If the room is cool, do not circulate the air.
3. If the room is cool and moist, circulate the air slightly.
A knowledge engineer determines membership functions that map temperatures
to fuzzy values and map moisture measurements to fuzzy values.
198
Inference
Evaluates all rules and determines their truth values. If an input does not
precisely correspond to an IF THEN rule, partial matching of the input data is
used to interpolate an answer.
Continuing the example, suppose that the system has measured temperature
and moisture levels and mapped them to the fuzzy values of .7 and .1
respectively. The system now infers the truth of each fuzzy rule.
To do this a simple method called MAX-MIN is used. This method sets the
fuzzy value of the THEN clause to the fuzzy value of the IF clause. Thus, the
method infers fuzzy values of 0.7, 0.1, and 0.1 for rules 1, 2, and 3
respectively.
199
Composition
Combines all fuzzy conclusions obtained by inference into a single conclusion.
Since different fuzzy rules might have different conclusions, consider all rules.
Continuing the example, each inference suggests a different action
rule 1 suggests a "high" circulation level
rule 2 suggests turning off air circulation
rule 3 suggests a "low" circulation level.
A simple MAX-MIN method of selection is used where the maximum fuzzy value
of the inferences is used as the final conclusion. So, composition selects a fuzzy
value of 0.7 since this was the highest fuzzy value associated with the inference
conclusions.
200
Defuzzification
Convert the fuzzy value obtained from composition into a “crisp” value. This
process is often complex since the fuzzy set might not translate directly into a
crisp value.Defuzzification is necessary, since controllers of physical systems
require discrete signals.
Continuing the example, composition outputs a fuzzy value of 0.7. This
imprecise value is not directly useful since the air circulation levels are “none”,
“low”, and “high”. The defuzzification process converts the fuzzy output of
0.7 into one of the air circulation levels. In this case it is clear that a fuzzy
output of 0.7 indicates that the circulation should be set to “high”.
201
Defuzzification
There are many defuzzification methods. Two of the more common
techniques are the centroid and maximum methods.
In the centroid method, the crisp value of the output variable is
computed by finding the variable value of the center of gravity of the
membership function for the fuzzy value.
In the maximum method, one of the variable values at which the fuzzy
subset has its maximum truth value is chosen as the crisp value for the
output variable.
202
Example: Design of Fuzzy Expert System – Washing
Machine
0.7
0.2
X1
Demystifying AI algorithms
DeFuzzification
Washing Time Long = (Y- 30)/(40-30)
Washing Time Medium = (Y- 20)/(30-20)
5 10 20 30 40 60
(Y – 20)/(30-20) = 0.5
X1 and X2 = 0.5 Y – 20 = 0.5* 10 = 5
Y = 25 Mins
Demystifying AI algorithms
Knowledge and Reasoning
Table of Contents
• Knowledge and reasoning-Approaches and issues of knowledge reasoning-
Knowledge base agents
• Logic Basics-Logic-Propositional logic-syntax ,semantics and inferences-
Propositional logic- Reasoning patterns
• Unification and Resolution-Knowledge representation using rules-Knowledge
representation using semantic nets
• Knowledge representation using frames-Inferences-
• Uncertain Knowledge and reasoning-Methods-Bayesian probability and belief
network
• Probabilistic reasoning-Probabilistic reasoning over time
• Other uncertain techniques-Data mining-Fuzzy logic-Dempster -shafer theory
17-03-2021 18CSC305J_AI_UNIT3 207
Dempster Shafer Theory
• Dempster Shafer Theory is given by Arthure P.Dempster in 1967 and his student
Glenn Shafer in 1976.
This theory is being released because of following reason:-
• Bayesian theory is only concerned about single evidences.
• Bayesian probability cannot describe ignorance.
• DST is an evidence theory, it combines all possible outcomes of the problem.
Hence it is used to solve problems where there may be a chance that a different
evidence will lead to some different result.
The uncertainity in this model is given by:-
• Consider all possible outcomes.
• Belief will lead to believe in some possibility by bringing out some evidence.
• Plausibility will make evidence compatibility with possible outcomes.
) = ({
P(ϴ) = ({
Detectives after receiving the crime scene, assign mass probabilities to various elements of the
power set:
Event Mass
No one is guilty 0
B is guilty 0.1
J is guilty 0.2
S is guilty 0.1
Either B or J is guilty 0.1
Either B or S is guilty 0.1
Either S or J is guilty 0.3
One of the 3 is guilty 0.1
17-03-2021 18CSC305J_AI_UNIT3 212
Dempster Shafer Problem
Belief in A:
The belief in an element A of the power set is the sum of the masses of
elements which are subsets of A (including A itself)
Ex: Given A= {q1, q2, q3}
Bet (A)
={m(q1)+m(q2)+m(q3)+m(q1,q2)+m(q2,q3),m(q1,q3)+m(q1,q2,q3)}
Ex: Given the above mass assignments,
Bel(B) = m(B) =0.1
Bel (B,J) = m(B)+m(J)+m(B,J) = 0.1+0.2=0.1 0.4
RESULT: A {B} {J} {S} {B,J} {B,S} {S,J} {B,J,S}
•
M(A) 0.1 0.2 0.1 0.1 0.1 0.3 0.1
•
Bel (A) 0.1 0.2 0.1 0.4 0.3 0.6 1.0
Planning
4/7/2021 1
What is Planning?
• The task of coming up with a sequence of
actions that will achieve a goal is called
planning.
• Planning Environments
1. Classical Planning Environments
• Fully observable, deterministic, finite, static and
discrete.
2. Non classical Planning Environments
• Partially observable, stochastic with different
algorithms and agent designs.
4/7/2021 2
Planning (Contd..)
• Difficulty in problem-solving agent
– Performs irrelevant actions
• Have to explore all the states
• Ex: buy book with 10-digit ISBN 1010 actions
– Finding heuristics function
• Problem-solving agent lacks autonomy because it
depends on human to supply heuristic function for
each new problem.
– No problem decomposition
• All these problems are overcome by planning agent by
representing the goal as conjunction of subgoals.
4/7/2021 3
PLANNING PROBLEM
The planning problem is actually the question how to go to next state or the
goal state from the current state. It involves two things 'how' and 'when'.
• The planning problem is defined with:
1. Domain model
2. Initial state
3. Goal state (next state)
The domain model defines the actions along with the objects. It is necessary
to specify the operators too that actually describe the action. Along with this,
information about actions and state constraints while acting should also be
given. This entirely formulates the domain model.
The initial state is the state where any action is yet to take place (the stage
when the exam schedule is put up!).
The final state or the goal state is the state which the plan is intended to
achieve.
4/7/2021 4
Planning Problem
• Find sequence of actions - achieves a given
goal from a given initial world state.
– a set of operator descriptions
– an initial state description, and
– a goal state description or predicate,
• compute a plan
– a sequence of operator instances,
– executing them in the initial state will change the
world to a state satisfying the goal-state
description.
• Goals - specified as a conjunction of subgoals
to be achieved
4/7/2021 5
Simple Planning Agent
An agent interacts with real world via perception and
actions
Perception - sense the world and assess the situation
Actions - what the agent does in the domain.
Planning involves reasoning about actions that the agent
intends to carry out
This reasoning involves the representation of the world
that the agent has - representation of its actions.
Hard constraints - objectives have to be achieved
completely for success
The objectives - soft constraints, or preferences, to be
achieved as much as possible
4/7/2021 6
Planning vs. Problem solving
• Planning agent is very similar to problem solving agent
– Constructs plans to achieve goals, then executes them
• Planning is more powerful because of the
representations and methods used
• Search - proceeds through plan space rather than state
space
• Sub-goals - planned independently, it reduce the
complexity of the planning problem
4/7/2021 7
Planning Agents
• problem-solving agents are able to plan ahead - to
consider the consequences of sequences of actions -
before acting.
• knowledge- based agents can select actions based on
explicit, logical representations of the current state
and the effects of actions.
– This allows the agent to succeed in complex,
inaccessible environments that are too difficult for
a problem-solving agent
– Problem Solving Agents + Knowledge-based Agents
= Planning Agents
4/7/2021 8
Simple Planning Agent
• A simple planning agent is very similar to problem-solving agents in that it
constructs plans that achieve its goals, and then executes them.
• The limitations of the problem- solving approach motivates the design of
planning systems.
To solve a planning problem using a state-space search approach we would
let the:
• initial state = initial situation
• goal-test predicate = goal state description
• successor function computed from the set of operators
• once a goal is found, solution plan is the sequence of operators in the path
from the start node to the goal node
4/7/2021 9
Simple Planning Agent
• Planning can be viewed as a type of problem solving in which the
agent uses beliefs about actions and their consequences to search
for a solution over the more abstract space of plans, rather than
over the space of situations.
Algorithm of a simple planning agent:
12
State Representation
• A state is represented with a conjunction of positive
literals
• Using
– Logical Propositions: Poor Unknown
– FOL literals: At(Plane1,OMA) At(Plan2,JFK)
• FOL literals must be ground & function-free
– Not allowed: At(x,y) or At(Father(Fred),Sydney)
• Closed World Assumption
– What is not stated are assumed false
13
Goal Representation
• Goal is a partially specified state
• A proposition satisfies a goal if it contains all
the atoms of the goal and possibly others..
– Example: Rich Famous Miserable satisfies the
goal Rich Famous
14
Action Representation
At(WHI,LNK),Plane(WHI),
• Action Schema Airport(LNK), Airport(OHA)
– Action name Fly(WHI,LNK,OHA)
– Preconditions
At(WHI,OHA), At(WHI,LNK)
– Effects
• Example
Action(Fly(p,from,to),
PRECOND: At(p,from) Plane(p) Airport(from) Airport(to)
EFFECT: At(p,from) At(p,to))
15
Languages for Planning Problems
• STRIPS
– Stanford Research Institute Problem Solver
– Historically important
• ADL
– Action Description Languages
• PDDL
– Planning Domain Definition Language
16
Planning languages
• A language is the one that should be expressive.
• Three Languages
– I. Stanford Research Institute Problem Solver (STRIPS)
– 2. Action Description Language (ADL)
– 3. Planning Domain Description Language (PDDL)
1) Stanford Research Institute Problem Solver (STRIPS) :
Makes use of the first order predicates.
STRIPS allows function-free literals.
Example of a robot: The example involves a robot, a cup tea, guest and two
rooms. We want the robot to get the tea and give it to the guest.
The planning with STRIPS is done as follows:
Let us begin with the STRIPS representation for this example.
Initial and final states are depicted in figure.
4/7/2021 17
Example of a robot
4/7/2021 18
Block World
• There are ‘N’ number of Blocks resting on
table with specified sequence.
• Goal is to arrange in desired sequence.
• Available moves
– Put block on table
– Put a block on another block top
• State is represented using sequence of blocks
in current pos.
4/7/2021 19
STRIPS
• STRIPS stands for "STanford Research Institute Problem
Solver," was the planner used in Shakey, one of the first robots
built using AI technology ,which is an action-centric
representation ,for each action , specifies the effect of an
action.
4/7/2021 20
Block World Problem
• Action List:
SNo Action Precondition Effect
• Goal State:
4/7/2021 22
Block World Problem
Solution:
• Start State: On(A,B)
– On(A, table)
– On(B, table)
• Goal State: Stack(A,B)(
– On(A,B) Preconditions:
Holding(A) Pickup(A)
Clear(B)
Preconditions:
Arm Empty
On(A, Table)
Clear(A)
4/7/2021 23
Means - Ends Analysis
• Search strategies either reason forward of backward
• Mixed strategy - solve the major parts of problem first and
solve the smaller problems that arise when combining them
together.
• Such a technique is called "Means - Ends Analysis".
• Means-Ends Analysis is problem-solving techniques used in
Artificial intelligence for limiting search in AI programs.
• It is a mixture of Backward and forward search technique.
• The means -ends analysis process centers around finding the
difference between current state and goal state.
4/7/2021 24
Means - Ends Analysis
How means-ends analysis Works:
• The means-ends analysis process can be applied recursively
for a problem. It is a strategy to control search in problem-
solving.
Following are the main Steps which describes the working of
MEA technique for solving a problem.
1. First, evaluate the difference between Initial State and final
State.
2. Select the various operators which can be applied for each
difference.
3. Apply the operator at each difference, which reduces the
difference between the current state and goal state.
4/7/2021 25
MEA Algorithm
• Step 1: Compare CURRENT to GOAL, if there are no differences between
both then return Success and Exit.
• Step 2: Else, select the most significant difference and reduce it by doing
the following steps until the success or failure occurs.
a. Select a new operator O which is applicable for the current
difference, and if there is no such operator, then signal failure.
b. Attempt to apply operator O to CURRENT. Make a description of two
states.
i) O-Start, a state in which O?s preconditions are satisfied.
ii) O-Result, the state that would result if O were applied In O-start.
c. If
(First-Part <------ MEA (CURRENT, O-START)
And
(LAST-Part <----- MEA (O-Result, GOAL), are successful, then signal
Success and return the result of combining FIRST-PART, O, and LAST-
PART.
4/7/2021 26
Example of Mean-Ends Analysis:
• Apply MEA to get the goal state.
• Solution:
• To solve the above problem, first find the differences between initial states
and goal states, and for each difference, generate a new state and will
apply the operators. The operators we have for this problem are:
• Move
• Delete
• Expand
4/7/2021 27
Example of Mean-Ends Analysis:
Step 1: Evaluate Initial State
Step 3: Apply Move Operator
4/7/2021 28
NON-LINEAR PLANNING
• A plan that consists of sub-problems, which are solved
simultaneously is said non-linear plan.
• In case of the goal stack planning there are some problems. To
achieve any goal, it could have an impact on the one that has
been achieved.
4/7/2021 29
NON-LINEAR PLANNING (Contd..)
There is a concept of constraint posting that
comes with non-linear planning. The constraint
posting states that the plan can be built by
• 1. Addition of operators or suggesting
operators
• 2. Ordering them
• 3. Binding the variables to the operators
4/7/2021 30
Conditional Planning
• Conditional planning has to work regardless of the outcome of
an action.
• The outcome of actions cannot be determined so the
environment is said to be nondeterministic.
• It’s a way to deal with uncertainty by checking what is actually
happening in the environment at predetermined points in the
plan. (Conditional Steps)
Example:
Check whether SFO airport (San Francisco International
Airport) is operational. If so, fly there; otherwise, fly to some
other place.
4/7/2021 31
Conditional Planning
• Three kind of Environments
Fully Observable
• The agent always knows the current state
Partially Observable
• The agent knows only a certain amount about
the actual state. (much more common in real
world)
Unknown
• The agent knows nothing about the current
state
4/7/2021 32
Conditional Planning in Fully
Observable Environments
• Agent used conditional steps to check the
state of the environment to decide what to do
next.
• Plan information stores in a library Ex:
Action(Left) Clean v Right
4/7/2021 33
Reactive Planning
• Reactive planning is planning under uncertainty.
• Makes use of the if-then rules.
• The reactive planners are based on the concept that they should be able
to handle an unknown situation too. So, the reaction rules are used that
help them in doing so.
• A rule selection is based on the priority and a holding condition that
maximises the priority.
• The rule which is at present in execution is said to be active whereas the
and the ones with holding priority (we can call them possible competitors)
are pre-active others are inactive.
• A B-tree structure is used in reactive planning, where the things are
algorithm selects the rule. Sometimes, no rule can be selected. In such a
case, dependent on the algorithm implementation for rule selection.
4/7/2021 34
LEARNING
learning consists of various activities like
understanding, memorisation, knowledge
acquisition and inference.
Learning is a continuous process
Learning from observation is required to
construct meaningful classification of
observed objects and situations.
MACHINE LEARNING
ACTIVE LEARNING MECHANISM
Perceptual learning
– learning of new objects , categories , relations.
Episodic Learning
– Learning of events like What , where and when
Procedural learning
– actions and their sequences to accomplish a task.
Machine Learning
Machine learning is building and exploring of methods for
programming computer to make them Learn.
Machine learning Vs Human Learning
Machine Learning approach
Scope of machine learning
GOALS OF MACHINE LEARNING
• To produce learning algorithms with practical
value.
• Development and enhancement of computer
algorithms and models to meet the decision
making requirements in practical scenarios.
• To facilitate in building intelligent systems (IS)
that can be used in solving real time problems.
Challenges of Machine Learning
• Avaliability of limited learning data and
unknown perspectives.
• Aquiring Accurate , compact and precise
knowledge building.
• Require large working memory to store data.
• Focusing Too Much on Algorithms and Theories
• Monitoring and maintenance
Learning Concepts , methods and
models
Computational structure used in Machine
learning:
1. Functions.
4. Grammars
• Rote learning
• Learning from observations
• Supervised learning
• unsupervised learning
• semi-supervised learning
• ensemble learning
• Discovery based learning
• Learning by problem solving
Rote learning
•An agent is defined the computational entity which is capable of receiving the
environment and can act based on the situation.
•The agent is composed of learning element performance element and a curiosity
element.
•Based on the coordination between these elements the outcome of the agents
behaviour is measured.
Inductive Learning
● Inductive learning involves learning generalized rules from specific examples (can
think of this as the “inverse” of deduction)
● Main task: given a set of examples, each classified as positive or negative produce a
concept description that matches exactly the positive examples.
● The examples are coded in some representation language, e.g. they are coded by a
finite set of real-valued features.
● The concept description is in a certain language that is presumably a superset of
the language of possible example encodings.
● A “correct” concept description is one that classifies correctly ALL possible
examples, not just those given in the training set.
Decision Tree Learning
5. Travel back from the output layer to the hidden layer to adjust the weights such that the error is
decreased.
Forward pass:
computes ‘functional signal’, feed forward
propagation of input pattern signals through
network
Backward pass phase:
computes ‘error signal’, propagates the error
backwards through network starting at output
units (where the error is the difference
between actual and desired output values)
Support Vector Machines (SVM)
Supervised learning methods for classification and regression
relatively new class of successful learning methods -
62
Support Vectors
• Support Vectors are simply the co-ordinates of individual
observation. Support Vector Machine is a frontier which best
segregates the two classes (hyper-plane/ line).
• Support vectors are the data points that lie closest to the
decision surface (or hyperplane)
• They are the data points most difficult to classify
• They have direct bearing on the optimum location of the
decision surface
• We can show that the optimal hyperplane stems from the
function class with the lowest “capacity” (VC dimension).
• Support vectors are the data points nearest to the hyperplane,
the points of a data set that, if removed, would alter the position
of the dividing hyperplane. Because of this, they can be
considered the critical elements of a data set.
63
What is a hyperplane?
• As a simple example, for a classification task with
only two features, you can think of a hyperplane as a
line that linearly separates and classifies a set of
data.
• Intuitively, the further from the hyperplane our data
points lie, the more confident we are that they have
been correctly classified. We therefore want our data
points to be as far away from the hyperplane as
possible, while still being on the correct side of it.
• So when new testing data are added, whatever side
of the hyperplane it lands will decide the class that
we assign to it. 64
4/7/2021 65
How do we find the right
hyperplane?
• How do we best segregate the two classes within the data?
• The distance between the hyperplane and the nearest data
point from either set is known as the margin. The goal is to
choose a hyperplane with the greatest possible margin
between the hyperplane and any point within the training
set, giving a greater chance of new data being classified
correctly. There will never be any data point inside the
margin.
66
But what happens when there is
no clear hyperplane?
• Data are rarely ever as clean as our simple example above. A dataset will
often look more like the jumbled balls below which represent a linearly
non separable dataset.
• In order to classify a dataset like the one above it’s necessary to move
away from a 2d view of the data to a 3d view. Explaining this is easiest
with another simplified example. Imagine that our two sets of colored
balls above are sitting on a sheet and this sheet is lifted suddenly,
launching the balls into the air. While the balls are up in the air, you use
the sheet to separate them. This ‘lifting’ of the balls represents the
mapping of data into a higher dimension. This is known as kernelling.
67
Because we are now in three dimensions, our
hyperplane can no longer be a line. It must now be a
plane as shown in the example above. The idea is
that the data will continue to be mapped into higher
and higher dimensions until a hyperplane can be
formed to segregate it. 68
How does it work? How can we
identify the right hyper-plane?
69
Identify the right hyperplane
(Scenario-1):
• Here, we have three hyperplanes (A, B and C). Now,
identify the right hyperplane to classify star and circle.
70
Identify the right hyperplane
(Scenario-2):
• Here, we have three hyperplanes (A, B and C)
and all are segregating the classes well. Now,
how can we identify the right hyperplane?
• Some of you may have selected the hyper-plane B as it has higher margin
compared to A. But, here is the catch, SVM selects the hyperplane which
classifies the classes accurately prior to maximizing margin. Here,
hyperplane B has a classification error and A has classified all correctly.
Therefore, the right hyperplane is A.
73
Can we classify two classes (Scenario-4)?
• We are unable to segregate the two classes using a straight line, as one of
star lies in the territory of other (circle) class as an outlier.
• One star at other end is like an outlier for star class. SVM has a feature to
ignore outliers and find the hyperplane that has maximum margin. Hence,
we can say, SVM is robust to outliers.
74
Find the hyperplane to segregate
to classes (Scenario-5)
• In the scenario below, we can’t have linear hyperplane
between the two classes, so how does SVM classify these two
classes? Till now, we have only looked at the linear
hyperplane.
77
Scenario-5
• When we look at the hyperplane in original
input space it looks like a circle:
4/7/2021 78
Two Class Problem: Linear Separable
Case
Class 2
• Many decision
boundaries can
separate these
two classes
• Which one should
Class 1 we choose?
Example of Bad Decision
Boundaries
Class 2 Class 2
Class 1 Class 1
Good Decision Boundary: Margin Should Be
Large
• The decision boundary should be as far away
from the data of both classes as possible
–We should maximize the margin, m 2
m
w.w
Support vectors
datapoints that the margin
pushes up against
Class 2
The maximum margin linear
classifier is the linear classifier
Class 1
m with the maximum margin.
This is the simplest kind of
SVM (Called an Linear SVM)
What is Reinforcement Learning?
• Learning from interaction with an environment to
achieve some long-term goal that is related to the
state of the environment
• The goal is defined by reward signal, which must
be maximised.
• Agent must be able to partially/fully sense the
environment state and take actions to influence
the environment state
• The state is typically described with a feature-
vector
Reinforcement learning
4/7/2021 83
Exploration versus Exploitation
• We want a reinforcement learning agent to earn lots of
reward
• The agent must prefer past actions that have been
found to be effective at producing reward
• The agent must exploit what it already knows to obtain
reward
• The agent must select untested actions to discover
reward-producing actions
• The agent must explore actions to make better action
selections in the future
• Trade-off between exploration and exploitation
Reinforcement Learning Systems
• Reinforcement learning systems have 4 main
elements:
– Policy
– Reward signal
– Value function
– Optional model of the environment
Policy
• A policy is a mapping from the perceived
states of the environment to actions to be
taken when in those states
• A reinforcement learning agent uses a policy
to select actions given the current
environment state
On-policy versus Off-policy
• An on-policy agent learns only about the
policy that it is executing
• An off-policy agent learns about a policy or
policies different from the one that it is
executing
Reward Signal
• The reward signal defines the goal
• On each time step, the environment sends a
single number called the reward to the
reinforcement learning agent
• The agent’s objective is to maximise the total
reward that it receives over the long run
• The reward signal is used to alter the policy
Value Function (1)
• The reward signal indicates what is good in the
short run while the value function indicates what
is good in the long run
• The value of a state is the total amount of reward
an agent can expect to accumulate over the
future, starting in that state
• Compute the value using the states that are likely
to follow the current state and the rewards
available in those states
• Future rewards may be time-discounted with a
factor in the interval [0, 1]
Value Function (2)
• Use the values to make and evaluate decisions
• Action choices are made based on value
judgements
• Prefer actions that bring about states of highest
value instead of highest reward
• Rewards are given directly by the environment
• Values must continually be re-estimated from the
sequence of observations that an agent makes
over its lifetime
Model-free versus Model-based
• A model of the environment allows inferences to be made
about how the environment will behave
• Example: Given a state and an action to be taken while in
that state, the model could predict the next state and the
next reward
• Models are used for planning, which means deciding on a
course of action by considering possible future situations
before they are experienced
• Model-based methods use models and planning. Think of
this as modelling the dynamics p(s’ | s, a)
• Model-free methods learn exclusively from trial-and-error
(i.e. no modelling of the environment)
• This presentation focuses on model-free methods
Advantages of Reinforcement Learning
• It can solve higher-order and complex problems. Also, the solutions
obtained will be very accurate.
• The reason for its perfection is that it is very similar to the human learning
technique.
• Due to it’s learning ability, it can be used with neural networks. This can be
termed as deep reinforcement learning.
• Since the model learns constantly, a mistake made earlier would be
unlikely to occur in the future.
• Various problem-solving models are possible to build using reinforcement
learning.
• When it comes to creating simulators, object detection in automatic cars,
robots, etc., reinforcement learning plays a great role in the models.
• The best part is that even when there is no training data, it will learn
through the experience it has from processing the training data.
• For various problems, which might seem complex to us, it provides the
perfect models to tackle them.
4/7/2021 92
Disadvantages of Reinforcement Learning
4/7/2021 102
Ensemble Learning (Contd…)
Ensemble learning method is the one where multiple learners or
learning algorithms are trained.
• In most of the learning algorithms a single hypothesis drives
the learning.
• In ensemble learning method the whole collection or
ensemble of hypothesis is selected from the hypothesis space
and their predictions are combined.
• In this approach, the learners or referred to as base learners.
• The most commonly used ensemble learning methods are
1) Boosting
2) Bagging.
4/7/2021 103
Ensemble Learning (Contd..)
Boosting:
• Boosting can probably be defined as the method for
generating accurate predictions by combining the rules that
are comparatively inaccurate.
• Boosting works on the weighted training sets. The weights of
the training example reflects the importance of training
examples.
Bagging:
• In Bagging, the training data is resampled. This is referred to
as bootstrap sampling, where the training data with
replacement is taken in the learning approaches.
104
Learning for decision making
• It is observed from different learning mechanisms that
Capability to take decisions is increased.
• speaking about the supervisor and unsupervised methodologies
the decisions taken are not sequential in nature.
• That is, if the system make a mistake on one decision, this has
no bearing on the subsequent decisions.
• To cope up with this dynamic situation there is a need to
understand the perspective of decision making.
• Another aspect is environment and system Learning, which also
needs to be looked upon during decision making. While taking
decisions one specific learning approach may not be suitable.
• The learning approach is dependent on decision scenario.
105
Distributed learning
• In distributed learning the task of learning is distributed.
• Need for distributed learning - Arises due to large data sets
and time constraints.
• More than one agent in different parts of the data set. There
will be distributed learning algorithms taken part in each
partition to get the desired outcome, which would then be
combined.
• Efficiency of distributed learning is affected to look at. it is
extremely important that outcome of distributed learning
matches with the ones acheived under the absence of
distributed environment.
• Multi agent systems can be thought of as a subset of
distributed learning.
4/7/2021 106
•
Speedup learning
• Speed learning typically deals with speeding up
problem solving by effective use of problem
solving experience. Hence, Prayer problem solving
experience is an input for speed of learning.
• In this learning,
1) There is no option with the environment.
2) New problems cannot be solved.
So, speed up learning accelerates the process
experiences And prior observations.
4/7/2021
Speedup learning (Contd..)
4/7/2021 108
Generalized learning
• Another dimension to the speed up learning is generalized
learning. this is also known as explanation based learning.
• There are a number of issues with explanation based learning,
as it is implemented and embedded in system to solve real
life problems and is suitable for a particular set of problems
where the sequential processes once developed can be used
again and again.
• But this is not the case in many real life problems, where
dynamic change in environment demands the improvement in
the established scenarios and even there is a need to keep on
learning based on the new findings
•
4/7/2021 109
18CSC305J-Artificial Intelligence
Unit- V
22-04-2021 1
• Expert System Architecture • Advance topics in Artificial Intelligence- Cloud
Pros and cons of Expert system Computing and Intelligent agent
• Rule based systems • Business Intelligence and Analytics
Frame based expert system • Sentiment Analysis
• Case study • Deep Learning Algorithms
• NLP – levels of NLP • Planning and Logic in intelligent Agents
• Syntactic and Semantic Analysis
Information Retrieval
• Information Extraction
Machine Translation
• NLP Applications
22-04-2021 2
Expert Systems
22-04-2021 3
Expert Systems - Objectives
22-04-2021 4
Objectives
• Examine earlier expert systems which have given rise to
today’s knowledge-based systems
• Explore the applications of expert systems in use today
• Examine the structure of a rule-based expert system
• Learn the difference between procedural and
nonprocedural paradigms
• What are the characteristics of artificial neural systems
22-04-2021 5
What is an expert system?
“An expert system is a computer system that emulates, or acts in all
respects, with the decision-making capabilities of a human expert.”
22-04-2021 6
Architecture of Expert Systems
22-04-2021 7
Architecture of Expert Systems
Knowledge Base
Stores all relevant information, data, rules, cases, and
relationships used by the expert system.
Uses
•Rules
•If-then Statements
•Fuzzy Logic
Inference Engine
Seeks information and relationships from the knowledge
base and provides answers, predictions, and suggestions
the way a human expert would.
Uses
•Backward Chaining
•Forward Chaining
22-04-2021 8
Architecture of Expert Systems
Explanation Facility
Allows a user to understand how the expert system arrived at certain conclusions or results.
For example: it allows a doctor to find out the logic or rationale of the diagnosis made by a medical expert
system
User Interface
Specialized user interface software employed for designing, creating, updating, and using expert
systems.
The main purpose of the user interface is to make the development and use of an expert system easier
for users and decision makers
22-04-2021 9
General Methods of Inferencing
• Forward chaining (data-driven)– reasoning from facts to the conclusions
resulting from those facts – best for prognosis, monitoring, and control.
– Examples: CLIPS, OPS5
22-04-2021 10
Expert Systems Development
22-04-2021 11
Expert system technology may include:
• Programs
22-04-2021 12
Problem Domain vs. Knowledge Domain
22-04-2021 13
Problem and Knowledge Domain Relationship
22-04-2021 14
Advantages of Expert Systems
22-04-2021 15
Disadvantages of Expert Systems
22-04-2021 16
Representing the Knowledge
22-04-2021 17
Knowledge Engineering
The process of building an expert system:
22-04-2021 18
Development of an Expert System
22-04-2021 19
The Role of AI
22-04-2021 20
Uncertainty
• Both human experts and expert systems must be able to deal with
uncertainty.
• It is easier to program expert systems with shallow knowledge
than with deep knowledge.
• Shallow knowledge – based on empirical and heuristic
knowledge.
• Deep knowledge – based on basic structure, function, and
behavior of objects.
22-04-2021 21
Early Expert Systems
• DENDRAL – used in chemical mass spectroscopy to identify
chemical constituents
22-04-2021 22
Broad Classes of Expert Systems
22-04-2021 23
Problems with Algorithmic Solutions
22-04-2021 24
Considerations for Building Expert Systems
• Can the problem be solved effectively by conventional
programming?
• Is there a need and a desire for an expert system?
• Is there at least one human expert who is willing to cooperate?
• Can the expert explain the knowledge to the knowledge
engineer can understand it.
• Is the problem-solving knowledge mainly heuristic and
uncertain?
22-04-2021 25
Languages, Shells, and Tools
22-04-2021 26
Production Rules
• Knowledge base is also called production memory.
• Production rules can be expressed in IF-THEN pseudocode format.
• In rule-based systems, the inference engine determines which rule
antecedents are satisfied by the facts.
22-04-2021 27
Rule-Based Expert System
• A rule based expert system is the simplest form of artificial intelligence and uses prescribed knowledge
based rules to solve a problem
• The aim of the expert system is to take knowledge from a human expert and convert this into a number of
hardcoded rules to apply to the input data
• In their most basic form, the rules are commonly conditional statements (if a, then do x, else if b, then do
y)
• These systems should be applied to smaller problems, as the more complex a system is, the more rules
that are required to describe it, and thus increased difficulty to model for all possible outcomes
Example:
A very basic example of rule based expert system would be a program to direct the management of
abdominal aneurysms The system would input the diameter of an aneurysm Using conditional arguments,
the input diameter would be stratified to recommend whether immediate intervention was required, and if
not what appropriate follow up is recommended
Note: with problems related to radiological images, often preprocessing of the images is required prior to the expert
system being applied.
22-04-2021 28
Structure of a Rule-Based Expert System
22-04-2021 29
Rule-Based ES
22-04-2021 30
Example Rules
22-04-2021 31
Inference Engine Cycle
22-04-2021 32
Foundation of Expert Systems
22-04-2021 33
Markov Algorithm
• An ordered group of productions applied in order or priority to an input
string.
• If the highest priority rule is not applicable, we apply the next, and so on.
22-04-2021 35
Rete Algorithm
• Markov: too inefficient to be used with many rules
• Functions like a net – holding a lot of information.
• Much faster response times and rule firings can occur compared to a large
group of IF-THEN rules which would have to be checked one-by-one in
conventional program.
• Takes advantage of temporal redundancy and structural similarity.
• Looks only for changes in matches (ignores static data)
• Drawback is high memory space requirements.
22-04-2021 36
Frame-Based Expert System
• The expert systems which make use of frames for the knowledge are called
frame-based expert systems.
• What is a frame? – A frame is a data structure with typical knowledge
about the object or concept.
• Frame has its name and set of attributes
• Example : A car frame can have make, type, color and so on as
slots/attributes in the frame
• Each slot/ attribute has unique value associated to it
22-04-2021 37
Frame-Based Expert System
We can have the following included in the slot
1. Frame Name
2. Relationship with other frames
3. Values or Ranges
4. Procedural information
22-04-2021 39
Working of Frame-Based Expert System
• Method – A method is a procedure that is executed
when requested
• As an example, how the process of an expert system When needed and when required methods : Snapshot
22-04-2021 40
Guidelines to build a Frame-Based Expert System
22-04-2021 41
MYCIN
22-04-2021 42
MYCIN
•MYCIN was an early expert system that used artificial intelligence to
identify bacteria causing severe infections.
•recommend antibiotics, with the dosage adjusted for patient's body weight
•The MYCIN system was also used for the diagnosis of blood clotting
diseases.
•MYCIN was developed over five or six years in the early 1970s at Stanford
University.
•It was written in Lisp
22-04-2021 43
MYCIN
•MYCIN was a stand alone system that required a user to enter all relevant
information about a patient by typing in responses to questions MYCIN posed.
•MYCIN operated using a fairly simple inference engine, and a knowledge base of
~600 rules.
•It would query the physician running the program via along series of simple yes/no
or textual questions.
22-04-2021 44
Tasks and Domain
•Disease DIAGNOSIS and Therapy SELECTION
22-04-2021 45
Consultation System
22-04-2021 46
Consultation “Control Structure”
•Goal-directed Backward-chaining Depth-first Tree Search
•High-level Algorithm:
1.Determine if Patient has significant infection
2.Determine likely identity of significant organisms
3.Decide which drugs are potentially useful
4.Select best drug or coverage of drugs
22-04-2021 47
Static Database
22-04-2021 48
Dynamic Database
22-04-2021 49
Explanation System
22-04-2021 50
Xcon
•The R1 (internally called XCON, for eXpertCONfigurer) program was a production rule based system written
in OPS5 by John P. McDermott of CMU in 1978.
–configuration of DEC VAX computer systems
•ordering of DEC's VAX computer systems by automatically selecting the computer system components based
on the customer's requirements.
•XCON first went into use in 1980 in DEC's plant in Salem, New Hampshire. It eventually had about 2500 rules.
•By 1986, it had processed 80,000 orders, and achieved 9598% accuracy.
•It was estimated to be saving DEC $25M a year by reducing the need to give customers free components
when technicians made errors, by speeding the assembly process, and by increasing customer satisfaction.
•XCON interacted with the sales person, asking critical questions before printing out a coherent and workable
system specification/order slip.
•XCON's success led DEC to rewrite XCON as XSEL a version of XCON intended for use by DEC's salesforce to
aid a customer in properly configuring their VAX.
22-04-2021 51
XCON: Expert Configurer
22-04-2021 52
Natural Language
Processing (NLP)
22-04-2021 53
Natural language
• Natural languages are languages that living creatures use for
communication,
22-04-2021 54
Why Natural language processing?
• Huge amount of data?
– Internet=at least 2.5 billion pages
• Applications for processing large amounts of texts.
– Classify text into categories
– Index and search large texts
– Automatic translation
– Speech understanding: Understanding phone conversation
– Information extraction: Extract useful information from
resumes
– Automatic summarization
– Question answering
– Knowledge acquisition: knowledge from expert
– Text generations/dialogs
• All these requires natural language expertise.
22-04-2021 55
NLP Tasks
22-04-2021 56
Levels of NLP
22-04-2021 57
Syntactic Analysis
• Rules of syntax (grammar) specify the possible organization of words in
sentences and allows us to determine sentence’s structure(s)
• Checks that the sentence is correct according with the grammar and if so
returns a parse tree representing the structure of the sentence
22-04-2021 58
Syntactic Analysis - Grammar
• sentence -> noun_phrase, verb_phrase
• noun_phrase -> proper_noun
• noun_phrase -> determiner, noun
• verb_phrase -> verb, noun_phrase
• proper_noun -> [mary]
• noun -> [apple]
• verb -> [ate]
• determiner -> [the]
22-04-2021 59
Syntactic Analysis - Parsing
22-04-2021 60
Syntactic Analysis – Complications (1)
22-04-2021 61
Syntactic Analysis – Complications (2)
• Handling ambiguity
• Syntactic ambiguity: “fruit flies like a banana”
22-04-2021 62
Semantic Analysis
• Syntax analysis is doing the parsing activity
• But we need to understand the meaning of the words and it is done
by semantic analysis
• For example,
• ‘Keep the book on the table’ – Here table refers physical object
• ‘Learn the table of number 23’ – here table refers mathematics concept of
table
22-04-2021 63
Lexical Processing
• In lexical processing, the meaning of the tokens is found out
• Word sense disambiguation: Understanding the meaning of a
particular word in the context
• It is concerned with the sense where it would be operational
• It would be done with the help of semantic marker
• Semantic marker: ‘Keep’ in sentence 1
• Semantic marker: ‘Learn’ in sentence 2
22-04-2021 64
Semantic grammars
• Example,
• ‘The pen is on the ceiling’
• Solution is,
• S -> Action the Food
• Action -> eat|drink|shallow|chew – Set of words
• Food -> burger|sandwich|coke|pizza – Set of words
22-04-2021 65
Case Grammar
22-04-2021 66
Conceptual Dependency
22-04-2021 67
Information retrieval
22-04-2021 68
Information retrieval - Models
22-04-2021 69
Information retrieval - Models
22-04-2021 70
Information retrieval - Models
22-04-2021 71
Information retrieval - Models
22-04-2021 72
Information Extraction
22-04-2021 73
Information Extraction
22-04-2021 74
• Advance topics in Artificial Intelligence- Cloud Computing and
Intelligent agent
• Business Intelligence and Analytics
• Sentiment Analysis
• Deep Learning Algorithms
• Planning and Logic in intelligent Agents
22-04-2021 75
Advance topics in Artificial Intelligence- Cloud
Computing and Intelligent agent
Cloud computing
The practice of using a network of remote servers hosted on the
Internet
to:
store,
manage,
and process data,
rather than a local server or a personal computer.
22-04-2021 76
Cloud computing and
AI(contd.)
Cloud computing and AI
While artificial intelligence (A.I.) has struggled to gain
footholds in other niches, it is finding its place in the
world of cloud computing, a sort of revolution within the
revolution that could rapidly change the face of businesses
using cloud computing solutions over the next few years.
22-04-2021 77
Cloud computing and
AI(contd.)
In three areas of cloud computing, A.I. is taking long strides.
Those areas are
Parallel processing
Big Data
22-04-2021 78
What’s parallel processing and how it work in
cloud
•Parallel processing means more than one microprocessor handling
parts of the same overall task. Parallel processing essentially means
that multiple processors shoulder the load. To have multiple processors
working on the same problem at the same time, there are two big
things you need:
Latency
Bandwidth
22-04-2021 79
What’s parallel processing and
how it work in cloud(contd.)
Latency
it refers to the amount of time it takes for a processor to send results back
to the system. The longer the wait, the longer it will take the entire system
to process the problem.
Bandwidth
Bandwidth is a more common term, referring to how much data a processor
can send in a given length of time.
22-04-2021 80
ML algorithms for cloud
applications
Machine learning (ML) is a type of artificial
intelligence (AI) that allows software applications to
become more accurate in predicting outcomes
without being explicitly programmed
22-04-2021 81
ML algorithms for cloud applications(contd.)
ML algorithms for cloud applications involve:
Cognitive computing(to combine different patterns together; i.e. voice,
imagery or other such data; for mimicking human behavior)
Chatbots and virtual assistants (they are getting smarter every time they
have a conversation)
Internet of things-IoT (It connects every potentially “smart” machine in the
world to the cloud and add that massive amount of data to the conversation)
22-04-2021 82
How AI uses big data
As business enterprises increasingly need a massive data-
crunching champion, cloud computing companies have begun
to deploy Artificial Intelligence as a service (AIaaS). Once
AIaaS is deployed, it can begin crunching data at a faster
rate than any single microprocessor or human mind could
ever hope to compete with.
22-04-2021 83
AI has not come to take over our world, but to improve
the way we harness technology to make everything
better. Consider the surface of AI finally scratched. ??
22-04-2021 84
Business Intelligence and Analytics
22-04-2021 85
So, how does AI actually work
in the business world? let’s try
to understand what artificial
intelligence is and why it is so
important for today’s business
corporations.
22-04-2021 86
What is Business Intelligence (BI)?
Business intelligence systems are used to maintain, optimize and streamline current
operations. BI improves and maintains operational efficiency and helps businesses increase
organizational productivity. Business intelligence software confers many benefits, notably
powerful reporting and data analysis capabilities. Using BI’s rich visualization mechanisms,
managers are able to generate intuitive, readable reports that contain relevant, actionable
data.
Popular business intelligence solutions include; SAP BusinessObjects, QlikView, IBM Cognos,
Microstrategy, etc.
https://selecthub.com/business-intelligence/business-intelligence-vs-business-an
alytics/
22-04-2021 87
What is Business Analytics (BA)?
Popular business analytics solutions include; SAP Business Analytics Suite, Pentaho BA, Birst BI and Tableau BIg
Data Analytics.
https://selecthub.com/business-intelligence/business-intelligence-vs-business-an
alytics/
22-04-2021 88
Business Analytics vs. Business Intelligence
• What will happen?
• What if and Why did it
Vision, happen?
Busine Mission
Statemen
•
•
Predictive Modeling
Simulation/Optimization
ts • Advanced Statistic Models
ss Business
“Sustainability
” “Efficiency”
“Innovation”
• Data Mining (Text,
Multimedia)
Analyti
• Data Science
Services &
Ne Optimized
w Business
Servic Retired
cs
Services
es
Objectives
Digital
Services • Who did that task?
Organization • What happened?
CM CEO
CO CF • Dashboards, Alerts
O O O • Scorecards
B
Monitoring
Business Process as a
More Flexible More Control • Slice & Dice,
Service Drilling
Digital
I New Customers,
Channels Initiatives
Business Process
Enterprise
Metamorphos
is
• Reports
Digital • DWH
Big Platform Digital
Securit
• Data
Data Lake
Cloud y
Danairat,
22-04-2021 2016 89
Choosing between Business Intelligence (BI)
and Business Analytics (BA)
https://selecthub.com/business-intelligence/business-intelligence-vs-business-an
alytics/
22-04-2021 90
Choosing between Business Intelligence (BI)
and Business Analytics (BA)
https://selecthub.com/business-intelligence/business-intelligence-vs-business-an
alytics/
22-04-2021 91
1. (Re)Identifying your
-
vision and missions
Strategic and Top Decision Making:-
Political and Policy Reports Vision,
- Economic Reports Mission
- Customer Analytic Statemen
Trends ts
- Technology Trends “Sustainability
” “Efficiency”
- Economic Value Business
“Innovation”
Services &
Ne Optimized
w Business
Servic Retired
es Services
Objectives
Services
Digital
Big Platform Digital
Securit
Data
Cloud y
22-04-2021 92
2. Identifying Business
Services and Objectives
Vision,
Business Services/Objectives:- Mission
- Social Listening Analytics Statemen
- Customer Experiences / UX ts
- Discover Unman Customers “Sustainability
” “Efficiency”
- Demographic Analytics Business
“Innovation”
- Voice of Customers Services &
- Objectives/Measurement Ne Optimized
w Business
Servic Retired
s Results es Services
Objectives
Services
Digital
Big Platform Digital
Securit
Data
Cloud y
22-04-2021 93
3. Identifying BI for Management Level
Vision,
Mission
Management BI:- Statemen
• Promotion Impact Report ts
• Channel Productivity “Sustainability
” “Efficiency”
• Operational Efficiency Business
“Innovation”
Digital
Big Platform Digital
Securit
Data
Cloud y
22-04-2021 94
Digital Organization
CE
O
CM CO CF
O O O
CM
O
22-04-2021 96
Top Business Questions from COO
CO
O
22-04-2021 97
Top Business Questions from CFO
CF
O
Digital
Big Platform Digital
Securit
Data
Cloud y
22-04-2021 99
Key Questions Type in each level of enterprise
Vision,
Mission Wh
Statemen y
ts
“Sustainability
” “Efficiency”
Business
“Innovation”
Digital Wha
Big Platform Digital
Securit t
Data
Cloud y
Danairat,
22-04-2021 2016 100
5. Identifying BI and BA Platform
Vision,
Mission
Statemen
ts
“Sustainability
” “Efficiency”
Business
“Innovation”
Services &
Ne Optimized
w Business
Servic Retired
BI &
es Services
Objectives
Digital
Services
Business
Organization Analytics
CM
O
CEO
CO
O
CF
O
Platforms :-
• Traditional BI
Business Process as a • Big Data
More Flexible More Control
Service • Cloud
Digital • Digital Security
Enterprise
New Customers,
Channels Initiatives Metamorphos
is
Business Process
Data IoT, Smart Smart
Optimization/Outsourcing
Monetization Devices Workforce
Digital
Big Platform Digital
Securit
Data
Cloud y
22-04-2021 101
Summary
• What will happen?
• What if and Why did it
Vision, happen?
Busine Mission
Statemen
•
•
Predictive Modeling
Simulation/Optimization
ts • Advanced Statistic Models
ss Business
“Sustainability
” “Efficiency”
“Innovation”
• Data Mining (Text,
Multimedia)
Analyti
• Data Science
Services &
Ne Optimized
w Business
Servic Retired
cs
Services
es
Objectives
Digital
Services • Who did that task?
Organization • What happened?
CM CEO
CO CF • Dashboards, Alerts
O O O • Scorecards
B
Monitoring
Business Process as a
More Flexible More Control • Slice & Dice,
Service Drilling
Digital
I New Customers,
Channels Initiatives
Business Process
Enterprise
Metamorphos
is
• Reports
Digital • DWH
Big Platform Digital
Securit
• Data
Data Lake
Cloud y
Danairat,
22-04-2021 2016 102
Big Data for Business Analytics Platform
22-04-2021 103
Internet of Things and Real-time Data Feeds
Applicatio
n
Areas
Smart Smart Smar Smart E-Health Retail Logistics Industria
Cities Environme t Agricultur l
nt Energ e Control
y
Monika, 37
2015
22-04-2021 104
Smart Home
Monika, 38
2015
22-04-2021 105
Chatbots, virtual assistants, and
Based on these business intelligence bots
capabilities, we
have seen
Targeted online
multiple advertising
applications of
artificial Predictive
analytics
intelligence in
business in the Voice
form of: recognition
Pattern
22-04-2021
recognition 106
Sentiment Analysis
22-04-2021 107
Sentiment Sentiment Analysis
22-04-2021 108
22-04-2021 109
22-04-2021 110
22-04-2021 111
Sentiment analysis has many other
names
• Opinion extraction
• Opinion mining
• Sentiment mining
• Subjectivity
11
2
analysis
22-04-2021
What is SA & OM?
• Identify the orientation of opinion in a piece of text
22-04-2021 113
Positive or negative movie
review?
• unbelievably disappointing
• Full of zany characters and richly applied satire, and
some great plot twists
• this is the greatest screwball comedy ever filmed
• It was pathetic. The worst part about it was the
11
4 boxing scenes.
22-04-2021
Why sentiment
analysis?
• Movie:is this review positive or negative?
• Products: what do people think about the new iPhone?
• Public sentiment: how is consumer confidence? Is
despair increasing?
• Politics: what do people think about this candidate or
11
5
issue?
• Prediction: predict election outcomes or market
trends from sentiment
22-04-2021
Why compute affective
meaning?
• Detecting:
• sentiment towards politicians, products, countries, ideas
• frustration of callers to a help line
• stress in drivers or pilots
• depression and other medical conditions
• confusion in students talking to e-‐tutors
• emotions in novels (e.g., for studying groups that are feared over
time)
• Could we generate:
• emotions or moods for literacy tutors in the children’s storybook
domain
22-04-2021 116
Scherer’s typology of affective
states
Emotion: relatively brief episode of synchronized response of all or most
organismic subsystems in response to the evaluation of an event as being of
major significance
angry, sad, joyful, fearful, ashamed, proud, desperate
Mood: diffuse affect state …change in subjective feeling, of low intensity but
relatively long duration, ojen without apparent cause
cheerful, gloomy, irritable, listless, depressed, buoyant
Interpersonal stance: affective stance taken toward another person in a specific
interaction, coloring the interpersonal exchange
distant, cold, warm, supportive, contemptuous
A]tudes: relatively enduring, affectively colored beliefs, preferences
predispositions towards objects or persons
liking, loving, hating, valuing, desiring
Personality
22-04-2021 traits: emotionally laden, stable personality dispositions and 117
Google Product
Search
• a
11
8
22-04-2021
TwiGer
sentiment:
Johan Bollen, Huina Mao, Xiaojun Zeng.
2011.
Twitter mood predicts the stock
market,
Journal of Computational Science 2:1,
1-‐8. 10.1016/j.jocs.2010.12.007.
11
9
22-04-2021
Bollen et al.
(2011)
• CALM
predicts
DJIA 3 days
Jones
Dow
later
• At least one
12
0
current
CAL
hedge fund
uses this
M
algorithm
22-04-2021
22-04-2021 121
22-04-2021 122
22-04-2021 123
DEEP LEARNING
22-04-2021 124
22-04-2021
125
22-04-2021 126
MACHINE LEARNING
22-04-2021 127
ML VS DL
22-04-2021 128
DEEP LEARNING
•It’s a type of ML inspired by
human brain.
22-04-2021 131
CONVOLUTIONAL
NEURAL NETWORK (CNN)
• Image
recognition
• Image
classification
• Object detection
22-04-2021 132
CNN LAYER
22-04-2021 133
CONVOLUTION LAYER
22-04-2021 134
Image Filter Convolved
Matrix Matrix Feature
22-04-2021 135
STRID
E
22-04-2021 136
PADDING
22-04-2021 137
SEPARABLE
CONVOLUTION LAYER
22-04-2021 138