0% found this document useful (0 votes)
36 views48 pages

Chapter 4-5

Uploaded by

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

Chapter 4-5

Uploaded by

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

Chapter Four

Knowledge Based Agents

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 :

 maintaining an internal state of knowledge

 reason over that knowledge

 update their knowledge after observations and take actions.

• Knowledge-based agents are composed of two main parts:

– Knowledge-base and

– Inference system.
2013 2
Cont’d
A knowledge-based agent must able to :
•represent states, actions, etc.

•incorporate new percepts

•update the internal representation of the world

•deduce the internal representation of the world

•deduce appropriate actions.

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.

•Inference system allows us to add a new sentence to the knowledge


base.
•A sentence is a proposition about the world.

•Inference system applies logical rules to the KB to deduce new


information.
•Inference system generates new facts so that an agent can update the
KB.
•An inference system works mainly in two rules which are given as:
Forward chaining
2013 7
Backward chaining
Logical Agents
Humans know things and do reasoning, which are important for artificial
agents.

 Knowledge-based agents benefit from knowledge expressed in general


forms, combining information to suit various purposes

 Knowledge and reasoning is important when dealing with partially


observable environments

 Understanding natural language requires inferring hidden states

 Flexibility for accepting new tasks

2013 8
Logic
• Logic itself is not a way for computers to store knowledge.

• It proves to be a vital tool to think about how computers store


knowledge.
• Logic is part of mathematics and can be used in various forms to
reason about the correctness of computational representation and
inference.

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.

‘10 mmHg > 90 mmHg’


 Statements like these are called propositions and are usually
denoted in propositional logic by uppercase letters.
 Simple propositions such as P and Q are called atomic
propositions or atoms for short.

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

– Premise: John is a squeeg

– Conclusion : John is a moof


Expert System 11
Logic connectives
• In the language of propositional logic, we have the following
five connectives at our disposal:
negation: ¬ (not)

conjunction: ∧ (and)

disjunction: ∨ (or)

implication: → (if then)

bi-implication: ↔ (if and only if)

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

• A contradiction compound statement that is always false

• Contingent statement is one that is neither a tautology nor


contradiction (may be some times true some times false)
• Example: the truth table of P V ~P shows it is a tautology

whereas P ^ ~P is a contradiction

Show that the truth table of PV~P is tautology and P ^ ~P is a


contradiction
Expert System 15
Inference in propositional Logic
 In artificial intelligence, we need intelligent computers which can
create new logic from old logic or by evidence.
 Inference is generating the conclusions from evidence and facts.

 Inference rules are the templates for generating valid arguments.

 In inference rules, the implication among all the connectives plays


an important role.

Following are some terminologies related to inference rules:

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.

Let us first introduce the language of first-order predicate logic.

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

All women are humans

Therefore: All women 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

(f(c) V b(c) V s(c,m))  h(c)

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.

Examples of knowledge-based systems include expert systems, which


are so called because of their reliance on human expertise.

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

– what kinds of reasoning can be done


2013 with that knowledge. 25
What to represent
• Object: All the facts about objects in our world domain.

• Events: Events are the actions which occur in our world.

• Performance: It describe behavior which involves knowledge


about how to do things.
• Meta-knowledge: It is knowledge about what we know.

• 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

 Business applications in the form of production rules

 Semantic networks, which organize knowledge through


nodes in a graph rather than data structure and represent
relationships between the facts by links between the nodes

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:

– Syntax: describes how sentences are formed in the language

– Semantics: describes the meaning of sentences, what is it the


sentence refers to in the real world

– Computational aspect: describes how sentences and objects


are manipulated in concordance with semantically conventions

Expert System 29
Important KR questions to be considered

Representational adequacy (suitability)-should


allow to represent the knowledge we need

Representational quality

computational cost of related inferences,

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.

Unlike intelligent agents that act on information provided by a programmer,


learning agents are able to perform tasks, analyze performance, and look for
new ways to improve on those tasks - all on their own.

It also requires a long lifetime to improve its behavior enough, and we


generally want our agents in games to behave intelligently from the start.

The human is an example of a learning agent. For example, a human can


learn to ride a bicycle, even though, at birth, no human possesses this skill.
2013 33
Cont’d…
It also requires a long lifetime to improve its behavior enough, and
we generally want our agents in games to behave intelligently
from the start.

The human is an example of a learning agent. For example, a


human can learn to ride a bicycle, even though, at birth, no human
possesses this skill.

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.

 The sensors form a very crucial part of every AI based agent in


improving its performance and helping the agent to act like a human.

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.

 The better performance we want in our agent, the better processor


should be designed for it.

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:

• A direct mapping from conditions on the current state to actions


• A means to infer relevant properties of the world from the percept sequence.

• Information about the way the world evolves and about the results of possible
actions the agent can take

• Utility information indicating the desirably of world states


• Action-value information indicating the desirably of actions
• Goals that describe classes of states whose achievement maximizes the agent’s
utility

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.

• Stimuli from external environment or inputs from sensory organs are


accepted by dendrites.
• These inputs create electric impulses, which quickly travel through
the neural network.
2013 42
Cont’d…
 A neuron can then send the message to other neuron to handle the
issue or does not send it forward.
 ANNs are composed of multiple nodes, which imitate
biological neurons of human brain.
 The neurons are connected by links and they interact with each
other.
 The nodes can take input data and perform simple operations on
the data.
 The result of these operations is passed to other neurons.

 The output at each node is called its activation or node value.


2013 43
Cont’d

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.

• They are used in pattern generation/recognition/classification.

•They have fixed inputs and outputs.

2013 45
Cont’d…
2. Feed-Back ANN
•Here, feedback loops are allowed.

•They are used in content addressable memories

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

You might also like