Chapter 4-5
Chapter 4-5
2013 1
Knowledge based agents
• An intelligent agent needs knowledge about the real world for
taking decisions and reasoning to act efficiently.
• Knowledge-based agents are those agents who have the capability of :
– Knowledge-base and
– Inference system.
2013 2
Cont’d
A knowledge-based agent must able to :
•represent states, actions, etc.
2013 3
• The architecture of knowledge-based agent:
2013 4
Cont’d
• The knowledge-based agent (KBA) take input from the
environment by perceiving the environment.
• The input is taken by the inference engine of the agent and
which also communicate with KB to decide as per the
knowledge store in KB.
• The learning element of KBA regularly updates the KB by
learning new knowledge.
2013 5
Cont’d
Knowledge base:
•Knowledge-base is a central component of a knowledge-based
agent.
•It is a collection of sentences (here 'sentence' is a technical term and
it is not identical to sentence in English).
• These sentences are expressed in a language which is called a
knowledge representation language.
•The Knowledge-base of KBA stores fact about the world.
•Knowledge-base is required for updating knowledge for an agent to
learn with experiences and take action as per the knowledge.
2013 6
Inference system
•Inference means deriving new sentences (decisions) from old.
2013 8
Logic
• Logic itself is not a way for computers to store knowledge.
Types of Logic
Propositional Logic
Predicate Logic
Expert System 9
Propositional logic
Propositional logic may be viewed as a representation language
which allows us to express and reason with statements that are
either true or false.
Expert System 10
Cont..
• The oldest and one of the simplest type of formal logic is the
syllogism
• Formal logic is concerned with the syntax of the statements rather
than semantics
• An example of the formal logic, consider the syllogism with the
nonsense words squeeg and moof
– Premise: All squeegs are moofs
conjunction: ∧ (and)
disjunction: ∨ (or)
Expert System 12
Cont..
Expert System 13
Exercise
I am hungry, I need food, I need coffee
•Prepare the truth table for the following
I need coffee and I need food
I am not hungry
I need food or coffee or tea
I am hungry and I need food or
coffee
Expert System 14
Tautology, contradiction and contingent
• A tautology compound statement that is always true
whereas P ^ ~P is a contradiction
2013 16
Cont’d
• Implication: It is one of the logical connectives which can be represented
as P → Q. It is a Boolean expression.
• Converse: The converse of implication, which means the right-hand side
proposition goes to the left-hand side and vice-versa. It can be written as Q
→ P.
• Contrapositive: The negation of converse is termed as contrapositive, and
it can be represented as ¬ Q → ¬ P.
• Inverse: The negation of implication is called inverse. It can be
represented as ¬ P → ¬ Q.
• Let’s prove using truth table:
• Hence from the above truth table, we can prove that P → Q is equivalent to
¬ Q → ¬ P, and Q→ P is equivalent2013to ¬ P → ¬ Q. 17
First-order (predicate) logic
In propositional logic, atoms are the basic constituents of
formulas which are either true or false.
A limitation of propositional logic is the impossibility to express
general statements concerning similar cases.
First-order predicate logic is more expressive than propositional
logic, and such general statements can be specified in its
language.
Expert System 18
Cont…
• Predicate logic is concerned with the internal structure of
sentences.
• In particular it is concerned with the use of special words called
quantifiers such as “all”, “some”, “no”
• Example : All humans are mortal
Expert System 19
First order predicate logic…
Example of a statement written in predicate logic:
Suppose that c stands for "the cat", m stands for "the mat", s stands
for "sits on", b stands for "black", f stands for "fat", h stands for
"happy".
The statement
is a way of writing "If the fat black cat sits on the mat then
it is happy".
Expert System 20
knowledge-based systems (KBS)
A knowledge-based system (KBS) is a form of artificial intelligence
(AI) that aims to capture the knowledge of human experts to support
decision-making.
Knowledge-based systems are computerized systems that emulate
human reasoning.
Such systems are built with specific knowledge in certain domains of
application, and operate in a way similar to that of a human expert.
The typical architecture of a knowledge-based system, which
informs its problem-solving method, includes a knowledge base and
an inference engine. 2013 21
Cont’d
The knowledge base contains a collection of information in a given
field -- medical diagnosis, for example.
The inference engine deduces insights from the information housed
in the knowledge base.
Knowledge-based systems also include an interface through which
users query the system and interact with it.
2013 22
Cont’d…
A knowledge-based system may vary with respect to its problem-
solving method or approach.
Some systems encode expert knowledge as rules and are therefore
referred to as rule-based systems.
Another approach, case-based reasoning, substitutes cases for
rules.
Cases are essentially solutions to existing problems that a case-
based system will attempt to apply previous solution to a new
problem.
2013 23
2013 24
Knowledge Representation
• Knowledge Representation is the systematic means of encoding
knowledge obtained from different sources in an appropriate
medium .
• Knowledge representation plays a crucial role in artificial
intelligence.
• Knowledge Representation is a radical and new approach in AI that
is changing the world.
• Knowledge representation (KR) is the study of
– how knowledge and facts about the world can be represented, and
• Facts: Facts are the truths about the real world and what we
represent.
Knowledge: Knowledge is awareness or familiarity gained by
experiences of facts, data, and situations.
2013 26
Knowledge representation…
Knowledge can be represented as:
Formal logic
Expert System 27
Knowledge representation: goals
rich enough to express the knowledge needed to solve the
problem
compact, natural and maintainable, amenable to efficient
computation as close to the problem as possible
able to express features of the problem we can exploit for
computational gain
able to trade off accuracy and computation time
Expert System 28
Knowledge representation languages
Goal: express the knowledge about the world in a computer
tractable form
• Key aspects of knowledge representation languages:
Expert System 29
Important KR questions to be considered
Representational quality
Expert System 30
End
2013 31
Chapter Five
Learning Agents
2013 32
Cont’d
A learning agent is a tool in AI that is capable of learning from its
experiences.
It starts with some basic knowledge and is then able to act and adapt
autonomously, through learning, to improve its own performance.
2013 34
Factors in learning agents
Knowledge Base:
The Knowledgebase is the fundamental part of any agent which works
on Artificial Intelligence and thus it has to be present inside every such
system.
All the information, past actions and their impacts, and all sorts of data
that the agent works on is present inside this Knowledge Base.
Sensors:
For Learning from the environment and the surroundings, the agent
must be able to observe and perceive information from the environment.
2013 35
Cont’d…
This is done through the sensors.
Processor:
The processor, which is the brain of the agent is somewhat the same
as the processor of a computer.
The difference is that it is much more advanced than the normal
processors as it can process in certain complex situations also such
as uncertainty in data, incomplete information about any task, etc.
2013 36
Cont’d…
This makes it much more efficient to use in real life situations.
Logic Unit:
The Logic Unit is responsible for drawing and implementing the
logic in any decision.
This unit comes into use every time the agent tries to conclude the
results from the multiple figures and statements available.
2013 37
Cont’d
Memory:
•All the information which is present inside the Knowledge Base
should be stored somewhere.
•Memory is also an important part for any agent to store all the data
and facts, and the results and the conclusions which are produced by
the processor and the logic unit.
2013 38
Cont’d…
Actuators:
The agent must perform certain actions or produce some result after
all the analysis and processing. This is done by the actuators.
In robotics, these actuators are the moving parts which perform
certain physical tasks, whereas, in other systems, these are similar to
output units which produce the processed data as the output.
Apart from these, there are also many other elements of the
Learning Agent like the Hardware, Design of the system, power
system, cooling systems, etc.
2013 39
LEARNING FROM OBSERVATIONS
An intelligent agent may have to learn, for instance, the following
components:
• Information about the way the world evolves and about the results of possible
actions the agent can take
2013 40
Cont’d
The type of feedback available for learning determines the nature
of the learning problem that the agent faces
Supervised learning involves learning a function from examples
of its inputs and outputs
Unsupervised learning involves learning patterns in the input
when no specific output values are supplied
In reinforcement learning the agent must learn from reinforcement (reward,
less exact feedback than in supervised learning)
The representation of the learned information plays an important
role in determining how the learning algorithm must work
2013 41
Neural Networks
• The idea of ANNs is based on the belief that working of human
brain by making the right connections, can be imitated using silicon
and wires as living neurons and dendrites.
• The human brain is composed of 86 billion nerve cells
called neurons.
• They are connected to other thousand cells by Axons.
2013 44
Types of Artificial Neural Networks
There are two Artificial Neural Network topologies
1. Feed-Forward ANN
•In this ANN, the information flow is unidirectional.
•A unit sends information to other unit from which it does not receive any
information.
•There are no feedback loops.
2013 45
Cont’d…
2. Feed-Back ANN
•Here, feedback loops are allowed.
2013 46
How ANN works?
• In the topology diagrams shown, each arrow represents a connection
between two neurons and indicates the pathway for the flow of
information.
• Each connection has a weight, an integer number that controls the
signal between the two neurons.
• If the network generates a “good or desired” output, there is no need to
adjust the weights.
• However, if the network generates a “poor or undesired” output or an
error, then the system alters the weights in order to improve subsequent
results.
2013 47
The End!!!!
2013 48