Sie sind auf Seite 1von 111

|| Shri Hari ||

INTRODUCTION
TO
ARTIFICIAL INTELLIGENCE

Prof. (Dr.) Ashish Sharma


Dept. of Computer Engineering & Applications
GLA University, Mathura
Jan 2, 2014
Artificial Intelligence

Encyclopedia Britannica:

AI is the ability of a digital computer or computer-


controlled robot to perform tasks commonly
associated with intelligent beings.

According to this definition, every computer is an AI-system.

Jan 2, 2014
2
Artificial Intelligence???

Elaine Rich

Relevant today & will still be relevant (hopefully!!) in 2050

Humans are still better in many fields

Computers are already better in many fields

Jan 2, 2014
3
The Differences Between Us and Them

Emotions

Understanding

Consciousness

4
Jan 2, 2014
AI is the branch of computer science concerned with making
computers behave like humans.

The term was coined in 1956 by John McCarthy at the


Massachusetts Institute of Technology.

5
Jan 2, 2014
Artificial intelligence includes
games playing: programming comps to play games sa chess
expert systems : programming comps to make decisions in real-
life situations (e.g some expert systems help doctors diagnose
diseases based on symptoms)
natural language : programming comps to understand natural
human languages
neural networks : Systems that simulate intelligence by
attempting to reproduce the types of physical connections that
occur in animal brains
robotics : programming comps to see & hear & react to other
sensory stimuli
6
Jan 2, 2014
Discipline that systematizes and automates reasoning
processes to create machines that:

Act like humans


Think like humans

Jan 2, 2014
7
Major Branches of AI

Jan 2, 2014
8
Currently, no computers exhibit full artificial intelligence (that
is, are able to simulate human behavior).
The greatest advances have occurred in the field of games
playing.

Deep Blue?

On May 11, 1997, an IBM computer called IBM Deep Blue


beat the world chess champion after a six-game match: two
wins for IBM, one for the champion and three draws. The
match lasted several days and received massive media
coverage around the world.

Jan 2, 2014
9
Behind the success
The system derived its playing strength mainly out of brute
force computing power.
It was a massively parallel, with 30 nodes, with each node
containing a 120 MHz.
Its chess playing program was written in C and ran under the
AIX operating system.
It was capable of evaluating 200 million positions per second,
twice as fast as the 1996 version.
The Deep Blue chess computer that defeated Kasparov in
1997 would typically search to a depth of between six and
eight moves to a maximum of twenty or even more moves in
some situations.
Jan 2, 2014
10
Things to be Done to build a system to solve a
problem

1. Define the problem precisely


Precise specifications of initial situation(s) & final acceptable solutions

2. Analyse the problem


Some very important features can have an immense impact on the
appropriateness of the techniques used.

3. Isolate and represent the task knowledge that is


necessary to solve the problem
4. Choose the best problem-solving techniques and apply
it to the particular problem.
11
Jan 2, 2014
E.g. Game of Tic-Tac-Toe
Given any board situation, there is only a finite number of moves that a player
can make.
Starting with an empty board, the first player may place an X in any one of
nine places. Each of these moves yields a different board that will allow the
opponent eight possible responses, and so on.
We can represent this collection of possible moves and responses by regarding
each board configuration as a node or state in a graph. The links of the graph
represent legal moves from one board configuration to another. The resulting
structure is a state space graph.
The state space representation thus enables us to treat all possible games of tic-
tac-toe as different paths through the state space graph.
Given this representation, an effective game strategy will search through the
graph for the paths that lead to the most wins and fewest losses and play in a
way that always tries to force the game along one of these optimal paths
Jan 2, 2014
12
Portion of the
State space for
Tic-Tac-Toe

Jan 2, 2014
13
E.g. Water Jug Problem
We give you two jugs with a maximum capacity of 4-
litre and 3-litre each and a pump to fill each of the jugs.
Neither have any measuring markers on it. Now your
job is to get exactly 2 litres of water into the
4-litre jug. How will you do that? How will you define
the state space?

The state space can be described as the set of ordered pairs of integers
(x, y), viz. x = 0, 1, 2, 3, or 4 and y = 0, 1,2, or 3; where x and y represent the
quantity of water in the 4-litre jug and 3-litre jug respectively.

The start state is (0, 0)

The goal state is (2, n)

Jan 2, 2014
14
Production rules for Water Jug Problem
Sl Current state Next State Description
No
1 (x,y) if x < 4 (4,y) Fill the 4 litre jug
2 (x,y) if y <3 (x,3) Fill the 3 litre jug
3 (x,y) if x > 0 (x-d, y) Pour some water out of the 4 litre jug
4 (x,y) if y > 0 (x, y-d) Pour some water out of the 3-litre jug
5 (x,y) if x>0 (0, y) Empty the 4 litre jug
6 (x,y) if y >0 (x,0) Empty the 3 litre jug on the ground
7 (x,y) if x+y >= 4 & y >0 (4, y-(4-x)) Pour water from the 3 litre jug into the 4 litre jug until the
4-litre jug is full
8 (x, y) if x+y >= 3 & x>0 (x-(3-y), 3) Pour water from the 4-litre jug into the 3-litre jug until the 3-
What other litre
rules can
jug is full we have?
9 (x, y) if x+y <=4 & y>0 (x+y, 0) Pour all the water from the 3-litre jug into the 4-litre jug

10 (x, y) if x+y <= 3 & x>0 (0, x+y) Pour all the water from the 4-litre jug into the 3-litre jug

11 (0,2) (2,0) Pour the 2 litres from 3-litre jug into the 4-litre jug
12
Jan 2, 2014 (2,y) (0,y) Empty the 2 litres in the 4-litre jug on the ground 15
Find a sequence of rules to solve the water jug problem
Required a control structure that loops litres in litres in Rule
through a simple cycle in which some the 4-litre the 3-litre applied
rule whose left side matches the current jug jug
state is chosen, the appropriate change
to the state is made as described in the 0 0 2
corresponding right side, and the 0 3 9
resulting state is checked to see if it
corresponds to goal state. 3 0 2
3 3 7
One solution to the water jug problem
4 2 5 or 12
Shortest such sequence will have a
impact on the choice of appropriate 0 2 9 or 11
mechanism to guide the search for 2 0
solution.

Jan 2, 2014
16
A Production system consists of:
A set of rules, each consisting of a LHS that determines the
applicability of the rule and a RHS that describes the operation
to be performed if the rule is applied.

Knowledge/database(s) that contain information appropriate


for the particular task. Some parts of the database may be
permanent, while other parts may pertain only to the solution.

A Control strategy that specifies the order in which the rules


will be compared to the database and a way of resolving the
conflicts that arise when several rules match at once.

A rule applier

17
Jan 2, 2014
A Heuristic is a technique that improves the efficiency of a search process,
possibly by sacrificing claims of completeness.

Heuristics are like tour guides

On the average they improve the quality of the paths that are explored.
Using Heuristics, we can hope to get good (though possibly non-optimal)
solutions to hard problems such as Travelling Salesman Problem in non
exponential time.

There are good general purpose heuristics that are useful in a wide variety of
problem domains.

Special purpose heuristics exploit domain specific knowledge


Jan 2, 2014
18
Advantages of Heuristics
It speeds up searching in case of problems which have exponential
solution time.
Rarely do we actually need the optimum solution; a good
approximation will usually serve very well. E.g.????
Trying to understand why a heuristic does or doesn't work, generally
leads to a deeper understanding of the problem.

Jan 2, 2014
19
Consider the problem of answering questions based on a database of simple
facts. E.g.

Question: Is Marcus alive?

Different reasoning
paths lead to the
answer. It does not
matter which path
we follow.

Jan 2, 2014
20
Cryptarithmetic
Solve
SEND + MORE = MONEY

SEND
9 5 6 7
+ MORE
1 0 8 5
---------
MONEY
1 0 6 52

Jan 2, 2014
21
It is a problem-solving technique that
It addresses the systematically explores a space of
problem of capturing problem states, i.e., successive and
in a language, i.e., one alternative stages in the problem-solving
suitable for computer process.
manipulation, the full Examples of problem states might include
range of knowledge the different board configurations in a
required for game or intermediate steps in a reasoning
intelligent behavior. process. This space of alternative solutions
is then searched to find an answer.
Jan 2, 2014
22
|| Shri Hari ||

How???

Knowledge Representation

Jan 5, 2013
23
Jan 5, 2013
24
Jan 5, 2013
25
The human brain

Seat of consciousness and cognition

Perhaps the most complex information processing machine


in nature

Historically, considered as a monolithic information


processing machine
Brain : a computational machine?

Information processing: brains vs computers

brains better at perception / cognition

slower at numerical calculations

parallel and distributed Processing

associative memory
Brain : a computational machine? (contd.)

Evolutionarily, brain has developed algorithms most


suitable for survival
Algorithms unknown: the search is on
Brain astonishing in the amount of information it
processes
Typical computers: 109 operations/sec
Housefly brain: 1011 operations/sec
Brain facts & figures
Basic building block of
nervous system: nerve cell
(neuron)
~ 1012 neurons in brain
~ 1015 connections between them
Connections made at synapses
The speed: events on millisecond scale in neurons,
nanosecond scale in silicon chips
Immense memory capacity

1 cc contains 1 terabyte of information

About 1000 cc makes up the whole brain

So about 1 million gigabyte or 1 petabyte of information

Entire archived content of internet is 3 petabyte


Power issues

By 2025, the memory of an artificial brain will use nearly a


gigawatt of power: the amount currently consumed by
entire Washington DC

On the other hand: brain uses only 12 watts or power, less


than the energy used by a typical refrigerator light
Intelligent Agent

sensors
percepts

?
environment
agent
actuators actions

An intelligent agent perceives its environment via


sensors and acts rationally upon that environment with its
actuators.
32
Jan 2, 2014
1. Games

Much of the early research in state space search was done


using common board games such as checkers, chess, etc
Most games are played using a well-defined set of rules: this
makes it easy to generate the search space and frees the
researcher from many of the ambiguities and complexities
inherent in less structured problems.
The board configurations used in playing games are easily
represented on a computer.

Jan 2, 2014
33
2. Automated Reasoning and Theorem Proving

It is one of the oldest & most fruitful branch of AI.


Because it is a formal system, logic lends itself to
automation.
A wide variety of problems can be attacked by representing
the problem description and relevant background
information as logical axioms and treating problem
instances as theorems to be proved.

Jan 2, 2014
34
3. Expert Systems

One major insight gained from early work in


problem solving was the importance of
domain-specific knowledge.
o A doctor, for example, is not effective at diagnosing
illness solely because she possesses some innate general
problem-solving skill; she is effective because she knows a
lot about medicine.
o Similarly, a geologist is effective at discovering mineral
deposits because he is able to apply a good deal of
theoretical and empirical knowledge about geology to the
problem at hand.
Jan 2, 2014
35
4. Natural Language Understanding & Semantics

One of the long-standing goals of AI is the creation of


programs that are capable of understanding and
generating human language.
Not only does the ability to use and understand
natural language seem to be a fundamental aspect of
human intelligence, but also its successful
automation would have an incredible impact on the
usability and effectiveness of computers themselves.

Jan 2, 2014
36
5. Planning and Robotics

Research in planning began as an effort to


design robots that could perform their tasks
with some degree of flexibility and responsiveness
to the outside world.
Briefly, planning assumes a robot that is capable of
performing certain atomic actions. It attempts to find
a sequence of those actions that will accomplish
some higher-level task, such as moving across an
obstacle-filled room.
Jan 2, 2014
37
6. Machine Learning
To solve problems computers require intelligence.
Learning is central to intelligence.
As intelligence requires knowledge, it is necessary for the computers
to acquire knowledge.

The capability of the systems to learn from experience, training,


analytical observation, and other means, results in a system that
can continuously self-improve and thereby exhibit efficiency and
effectiveness.
Jan 2, 2014
38
Intelligent Behaviour???
Learn from experience
Apply knowledge acquired from experience
Handle complex situations
Solve problems when imp information is missing
Determine what is important
React quickly and correctly to a new situation
Understand visual images
Process and manipulate symbols
Be creative and imaginative
39
Jan 2, 2014 Use heuristics
AI is a big domain and comprises of:
Artificial Neural Network
Expert System
Natural Language Processing
Fuzzy Logic
Genetic Algorithm

Jan 2, 2014
40
Feb 4, 2013
41
Biological Neuron

Cell structures
Cell body
Dendrites
Axon
Synaptic terminals

Feb 4, 2013
42
1. Soma is a large, round central body in which almost all the logical functions of the neuron are
realized (i.e. the processing unit).
2. The axon (output), is a nerve fibre attached to the soma which can serve as a final output channel of
the neuron. An axon is usually highly branched.

3. The dendrites (inputs) are a highly branching Synapses


tree of fibers. These long irregularly shaped
Axon from other
nerve fibers attached to the soma carrying neuron
electrical signals to the cell
Soma
4. Synapses are the point of contact between the
axon of one cell & the dendrite of another,
Dendrite
regulating a chemical connection whose Axon from other
strength affects the input to the cell. Dendrites

The schematic model of a


biological neuron

Feb 4, 2013
43
Biological NN
The many dendrites receive signals from other neurons.
The signals are electric impulses that are transmitted across a synaptic gap by
means of a chemical process.
The action of the chemical transmitter modifies the incoming signal (typically,
by scaling the frequency of the signals that are received) in a manner similar to
the action of the weights in an artificial neural network.
The soma, or cell body sums the incoming signals. When sufficient input is
received, the cell fires; that is, it transmits a signal over its axon to other cells.
It is often supposed that a cell either fires or doesn't at any instant of time, so
that transmitted signals can be treated as binary

Feb 4, 2013
44
Several key features of the processing elements of ANN are suggested by the properties
of biological neurons

1. The processing element receives many signals.

2. Signals may be modified by a weight at the receiving synapse.

3. The processing element sums the weighted i/ps.

4. Under appropriate circumstances (sufficient i/p), the neuron transmits a


single o/p.

5. The output from a particular neuron may go to many other neurons (the
axon branches).

Feb 4, 2013
45
6. Information processing is local.
7. Memory is distributed:
a) Long-term memory resides in the neurons' synapses or weights.
b) Short-term memory corresponds to the signals sent by the
neurons.
8. A synapse's strength may be modified by experience.
9. Neurotransmitters for synapses may be excitatory or inhibitory.

Feb 4, 2013
46
ANNs vs. Computers
Digital Computers Artificial Neural Networks
No requirement of an explicit description of the
Analyze the problem to be solved
problem.
Deductive Reasoning. We apply known rules to Inductive Reasoning. Given i/p & o/p data
input data to produce output. (training examples), we construct the rules.
Computation is centralized, synchronous, and Computation is collective, asynchronous, and
serial. parallel.

Not fault tolerant. One transistor goes and it no Fault tolerant & sharing of responsibilities.
longer works.
Dynamic connectivity.
Static connectivity. Applicable if rules are unknown or complicated, or
if data are noisy or partial.
Applicable if well defined rules with precise
input data.

Feb 4, 2013
47
Components of ANN
A technical neural network consists of simple processing
units, the neurons, and directed, weighted connections
between those neurons. Here, the strength of a connection (or
the connecting weight) between two neurons i and j is referred to
as wi,j

Connections carry information that is


processed by neurons
Data are transferred between neurons via connections with the
connecting weight being either excitatory or inhibitory.

Feb 4, 2013
48
Neurons
A NN consists of a large number of simple
processing elements called neurons.

Each input channel i can transmit a real value xi.


The primitive function f computed in the body of the abstract neuron can be selected
arbitrarily.
Usually the input channels have an associated weight, which means that the
incoming information xi is multiplied by the corresponding weight wi.
The transmitted information is integrated at the neuron (usually just by adding the
different signals) and the primitive function is then evaluated.

Feb 4, 2013
49
Fan- in Property
The number of incoming edges into a node is not restricted by some upper bound.
This is called the unlimited fan-in property of the computing units.

Evaluation of a function of n arguments

Feb 4, 2013
50
Activation Functions at the
Computing Units
Normally very simple activation functions of one argument are used at the nodes.
This means that the incoming n arguments have to be reduced to a single numerical
value.
Therefore computing units are split into two functional parts:
an integration function g that reduces the n arguments to a single value and
the output or activation function f that produces the output of this node taking that
single value as its argument.
Usually the integration function g is the addition function.

Generic computing unit


Feb 4, 2013
51
A NN is characterized by its:

1. Architecture

Pattern of connections between the neurons

2. Training/Learning algorithm

Methods of determining the weights on the connections

3. Activation function

Feb 4, 2013
52
Typically, neurons in the same layer behave in the same manner.
To be more specific, in many neural networks, the neurons within a
layer are either fully interconnected or not interconnected at all.
Neural nets are often classified as single layer or multilayer.
The i/p units are not counted as a layer because they do not perform
any computation.
So, the no. of layers in the NN is the no. of layers of weighted inter-
conneted links between slabs of neurons.

Feb 4, 2013
53
Architecture Terms
Feed forward
When all of the arrows connecting unit to unit in a network move only
from input to output
Recurrent or feedback networks
Arrows feed back into prior layers
Hidden layer
Middle layer of units
Not input layer and not output layer
Hidden units
Nodes that are situated between the input nodes and the output
nodes.
Perceptron
A network with a single layer of weights
54
Feb 4, 2013
Single layer Net
A single-layer net has one layer of connection weights.
The units can be distinguished as input units, which receive signals
from the outside world, and output units, from which the response of
the net can be read.
Although the presented network
is fully connected, the true
biological neural network may
not have all possible connections
- the weight value of zero can be
represented as ``no connection".

Feb 4, 2013
55
Multi - layer Net
More complicated mapping problems may require a multilayer network.
A multilayer net is a net with one or more layers (or levels) of nodes (the so
called hidden units) between the input units and the output units.

Multilayer nets can solve more


complicated problems than single-
layer nets can, but training may be
more difficult.
However, in some cases training
may be more successful, because it
is possible to solve a problem that a
single layer net cannot be trained to
perform correctly at all.

Feb 4, 2013
56
Recurrent Net
Local groups of neurons can be connected in either,
a feedforward architecture, in which the network has no loops, or
a feedback (recurrent) architecture, in which loops occur in the network
because of feedback connections.

Feb 4, 2013
57
Feedforward and Feedback

Feb 4, 2013
58
Learning algorithms for NN
A learning algorithm is an adaptive method by which a network of
computing units self-organizes to implement the desired behavior.
This is done by presenting some examples of the desired input output
mapping to the network.
o A correction step is executed iteratively until the network learns to
produce the desired response.
The learning algorithm is a closed loop of presentation of examples
and of corrections to the network parameters

Feb 4, 2013
59
Classes of learning algorithms
1. Supervised

Supervised learning denotes a method in which some input vectors are collected
and presented to the network. The output computed by the network is observed
and the deviation from the expected answer is measured.
The weights are corrected according to the magnitude of the error in the way
defined by the learning algorithm.
This kind of learning is also called learning with a teacher, since a control process
knows the correct answer for the set of selected input vectors.

Feb 4, 2013
60
Classes of learning algorithms
2. Unsupervised
Unsupervised learning is used when, for a given input, the exact numerical output a
network should produce is unknown.

In this case we do not know a priori which unit is going to specialize on which
cluster. Generally we do not even know how many well-defined clusters are
present. Since no teacher is available, the network must organize itself in
order to be able to associate clusters with units.

Feb 4, 2013
61
Types of Supervised learning algorithms
1. Reinforcement learning
Used when after each presentation of an input-output example we only know
whether the network produces the desired result or not. The weights are
updated based on this information (that is, the Boolean values true or false) so
that only the input vector can be used for weight correction.
2. Learning with error correction
The magnitude of the error, together with the input vector, determines the
magnitude of the corrections to the weights, and in many cases we try to
eliminate the error in a single correction step.

Feb 4, 2013
62
Classes of learning algorithms

Feb 4, 2013
63
One of the most important aspects of Neural Network is the learning process.
Learning can be done in supervised or unsupervised training.
In supervised training, both the inputs and the outputs are provided.
o The network then processes the inputs and compares its resulting outputs against
the desired outputs.
o Errors are then calculated, causing the system to adjust the weights which control
the network.
o This process occurs over and over as the weights are continually tweaked.
In unsupervised training, the network is provided with inputs but not with desired
outputs.
o The system itself must then decide what features it will use to group the input
data.

Feb 4, 2013
64
|| Shri Hari ||

Introduction, Expert system: features, characteristics,


development, activities, difference with conventional
methods, stages in ES development, Probability based ES,
Expert System tools and applications.
Introduction to GA, Procedures: representation,
initialization and selection, operators, mutation.
Introduction to Evolutionary programming,
Introduction to Fuzzy logic.
Introduction to Expert Systems
Historically, Expert Systems grew with AI, and can be
regarded as a branch of AI.

Expert System (ES) is a branch of


Artificial Intelligence that attempt
to mimic human experts.
Expert systems can either support decision makers
or completely replace them.

Expert systems are the most widely applied &


commercially successful AI technology.

66
April 10, 2014
What is an ES?
Prof. Edward Feigenbaum of Stanford University, leading
researchers in ES has produced the following definition:

" . . . An intelligent computer program that


uses knowledge and inference
procedures to solve problems that are
difficult enough to require significant
human expertise for their solution."
April 10, 2014 67
Computer software that:
Emulates human expert
Deals with small, well defined domains of expertise
Is able to solve real-world problems
Is able to act as a cost-effective consultant
Can explains reasoning behind any solutions it finds
Is be able to learn from experience.

April 10, 2014


68
What is an ES?
Expertise is the extensive, task-specific knowledge acquired from
training, reading, and experience.

The transfer of expertise from an expert to a computer and then to the


user involves four activities:
knowledge acquisition from experts or other sources.

knowledge representation in the computer.

knowledge inferencing, resulting in a recommendation for novices.

knowledge transfer to the user.

April 10, 2014 69


Conventional and ES
Conventional Systems Expert Systems
Knowledge and processing are Knowledge base is clearly separated
combined in one sequential program from the processing (inference)
mechanism (knowledge rules are
separated from the control)
Programs do not make mistakes (only Program may make mistakes.
programmers do)
Do not usually explain why input data Explanation is a part of most expert
are needed or how conclusions were systems
drawn
The system operates only when it is The system can operate with only a few
completed rules (as a first prototype)
Execution is done on a step-by-step Execution is done by using heuristics
(algorithmic) basis and logic
April 10, 2014 70
Conventional and ES

Conventional Systems Expert Systems


Needs complete information to operate Can operate with incomplete or
uncertain information
Effective manipulation of large Effective manipulation of large
databases knowledge bases
Representation and use of data Representation and use of knowledge

Efficiency is a major goal Effectiveness is a major goal

Easily deals with quantitative data Easily deals with qualitative data

April 10, 2014 71


Characteristics of Expert Systems
1. High-level expertise.
The most useful characteristic of an expert system.
This expertise can represent the best thinking of top experts in the field, leading to
problem solutions that are imaginative, accurate, and efficient.
2. Adequate response time.
The system must also perform in a reasonable amount of time, comparable to or
better than the time required by an expert to solve a problem.
3. Permits Inexact Reasoning.
These types of applications are characterized by information that is uncertain,
ambiguous, or unavailable and by domain knowledge that is inherently inexact.
4. Good Reliability.
The system must be reliable and not prone to crashes because it will not be used

72
April 10, 2014
5. Comprehensibility.
The system should be able to explain the steps of its reasoning while executing so that it is
understandable.
The systems should have an explanation capability in the same way that human experts are
suppose to be able to explain their reasoning.

6. Flexibility.
Because of the large amount of knowledge that an expert system may have, it is important to
have an efficient mechanism for modifying the knowledge base.

7. Symbolic Reasoning.
Expert systems represent knowledge symbolically as sets of symbols that stand for problems
concepts.
These symbols can be combined to express relationship between them. When these
relationship are represented in a program they are called symbol structures.
For example,
Assert: Damodar has a fever
Rule: IF person has fever THEN take Crocin
Conclusion: Damodar takes Crocin

April 10, 2014 73


8. Reasons Heuristically
Experts are adapt at drawing on their experiences to help them efficiently solved some
current problem.
Typical heuristics used by experts:
I always check the electrical first.
People rarely get a cold during the summer
If I suspect cancer, then I always check the family history.
9. Makes Mistakes
Expert systems can make mistakes.
Since the knowledge of expert have to be captured as close as possible in expert system,
like its human counterpart, it can make mistakes.
10. Thrives on Reasonable Complexity
The problem should be reasonably complex, not too easy or too difficult.

11. Focuses Expertise


Most experts are skillful at solving problems within their narrow area of expertise, but
have limited ability outside this area.

April 10, 2014 74


MYCIN
PROSPECTOR
Medical system for
Used by geologists to
diagnosing blood disorders.
identify sites for drilling or
First used in 1979
mining

LITHIAN
PUFF
Gives advice to archaeologists
Medical system
examining stone tools
for diagnosis of
respiratory conditions

DENDRAL Used to
identify the structure
of chemical
DESIGN ADVISOR compounds. First
Gives advice to used in 1965
designers of processor
chips

April 10, 2014


75
Why use Expert Systems?
(Advantages)

Experts are not always available. An ES can be used anywhere,


any time.
Human experts are not 100% reliable or consistent
Experts may not be good at explaining decisions
Cost effective
Capture of scarce expertise
Superior problem solving
Reliability

Work with incomplete information


April 10, 2014
Transfer of knowledge 76
|| Shri Hari ||

A class of probabilistic optimization algorithms


Inspired by the biological evolution process
Uses concepts of Natural Selection and Genetic Inheritance (Darwin
1859)
Originally developed by John Holland (1975)
Particularly well suited for hard problems where little is known about the
underlying search space
Widely-used in business, science and engineering
Genetic algorithms - biology
Organism has a set of rules (a blueprint) defining how it is built up
from the tiny building blocks of life.

Rules are encoded in the genes, which are connected together into
long strings called chromosomes.

Each gene represents a specific trait of the organism and has several
different settings.

When two organisms mate, their resultant offspring ends up having


shared genes - recombination.

Occasionally a gene may be mutated.

Life on earth has evolved to be as it is through the processes of


natural selection, recombination and mutation.

April 10, 2014


78
GA Operators
Selection
This operator selects chromosomes in the population for
reproduction. The fitter the chromosome, the more times it is likely
to be selected to reproduce.

Crossover
This operator randomly chooses a locus and exchanges the
subsequences before and after that locus between two chromosomes
to create two offspring. For example, the strings 10000100 and
11111111 could be crossed over after the third locus in each to
produce the two offspring 10011111 and 11100100.

April 10, 2014


79
GA Operators
Mutation
This operator randomly flips some of the bits in a
chromosome. For example, the string 00000100
might be mutated in its second position to yield
01000100. Mutation can occur at each bit position in
a string with some probability, usually very small
(e.g., 0.001).

April 10, 2014


80
Selection
It defines the way individuals in the current population are selected for
reproduction. There are many strategies for that (e.g. roulettewheel, ranked,
tournament selection, etc), but usually the individuals which are more fit are
selected.
Roulette wheel Selection
Each current string in the population has a slot assigned to it which is in
proportion to its fitness.
We spin the weighted roulette wheel thus defined n times (where n is the total
number of solutions).
Each time Roulette Wheel stops, the string corresponding to that slot is created.
Strings that are fitter are assigned a larger slot and hence have a better chance of
appearing in the new population.
April 10, 2014
81
Example Of Roulette Wheel Selection
No. String Fitnes % Of
s Total

1 169 14.4
01101
2 11000 576 49.2

3 01000 64 5.5

10011 361 30.9


4
Total 1170 100.0

April 10, 2014 82


Crossover
It is the process in which two chromosomes (strings) combine their genetic
material (bits) to produce a new offspring which possesses both their
characteristics.
Two strings are picked from the mating pool at random to cross over.
The method chosen depends on the Encoding Method.
Generally the chance of crossover is between 0.6 and 1.0

X6 i 1 0 00 1 0 1 00 00 X2 i

X1 i 0
1 11 00 00 0 11 11 11 X5i

April 10, 2014


83
X2 0 1 0 0 0 1 1 1 X5
Types of Crossover

Single point crossover

Two point crossover (Multi point crossover)

Uniform crossover

April 10, 2014


84
Mutation operator
Mutation represents a change in the gene.
Mutation is a background operator. Its role is to provide a
guarantee that the search algorithm is not trapped.
The mutation operator flips a randomly selected gene in a
chromosome.
The mutation probability is quite small in nature, and is kept
low for GAs, typically in the range between 0.001 and 0.01.

April 10, 2014


85
X6'i 1 0 0 0

X2'i 0 1 0 1
0

X1'i 0
1 1 1 1 1 1 X1"i
The number of bits
X5'i 0 1 0
1 0
1 to be inverted
depends on the
X2i 0 1 0 0 1 0 X2"i Mutation
Probability.
X5i 0 1 1 1

April 10, 2014


86
April 10, 2014
87
An example after Goldberg 89 (1)

Simple problem: max x2 over {0,1,,31}


GA approach:
Representation: binary code, e.g. 01101 13
Population size: 4
1-point xover, bitwise mutation
Roulette wheel selection
Random initialisation
We show one generational cycle done by hand
x2 example: selection
X2 example: crossover
X2 example: mutation
C rossover
Generation i
X1i 1 1 0 0 f = 36 X6i 1 0 00 1 0 1 00 00 X2i
X2i 0 1 0 0 f = 44
X3i 0 0 0 1 f = 14
X4i 1 1 1 0 f = 14 X1i 0 11 00 00
1 0 11 11 11 X5i
X5i 0 1 1 1 f = 56
X6i 1 0 0 1 f = 54
X2i 0 1 0 0 0 1 1 1 X5i
Generation (i + 1)
X1i+1 1 0 0 0 f = 56 Mutation
X2i+1 0 1 0 1 f = 50 X6'i 1 0 0 0
X3i+1 1 0 1 1 f = 44
X2'i 0 1 0 1
0
X4i+1 0 1 0 0 f = 44
X1'i 0
1 1 1 1 1 1 X1"i
X5i+1 0 1 1 0 f = 54
X6i+1 0 1 1 1 f = 56 X5'i 0 1 0
1 0
1

X2i 0 1 0 0 1 0 X2"i

X5i 0 1 1 1

April 10, 2014


92
FUZZY LOGIC
Fuzzy logic is the logic underlying approximate, rather than
exact, modes of reasoning.
It is an extension of multi-valued logic: Everything, including
truth, is a matter of degree.
It contains as special cases not only the classical two-value
logic and multi-value logic systems, but also probabilistic
logic.
A proposition p has a truth value
0 or 1 in two-value system,
element of a set T in multi-value system,
Range over the fuzzy subsets of T in fuzzy logic.
93
April 2007
FUZZY LOGIC
Boolean logic uses sharp distinctions.
Fuzzy logic reflects how people think.
Fuzzy logic is a set of mathematical principles for

Fuzzy logic is a set of mathematical principles for knowledge


representation and reasoning based on degrees of membership.

94
April 2007
TYPES AND MODELING OF UNCERTAINTY

95
April 2007
FUZZY vs PROBABILITY

Fuzzy Probability

Probability deals with uncertainty an likelihood

Fuzzy logic deals with ambiguity an vagueness

96
April 2007
FUZZY vs PROBABILITY

97
April 2007
NEED OF FUZZY LOGIC
Based on intuition and judgment.

No need for a mathematical model.

Provides a smooth transition between members and nonmembers.

Relatively simple, fast and adaptive.

Less sensitive to system fluctuations.

Can implement design objectives, difficult to express


mathematically, in linguistic or descriptive rules.

98
April 2007
CLASSICAL SETS (CRISP SETS)

Conventional or crisp sets are


Binary. An element either belongs to the set or does not.

{True, False}

{1, 0}

99
April 2007
CRISP SETS

100
April 2007
OPERATIONS ON CRISP SETS

UNION:

INTERSECTION:

COMPLEMENT:

DIFFERENCE:

101
April 2007
PROPERTIES OF CRISP SETS
The various properties of crisp sets are as follows:

102
April 2007
PROPERTIES OF CRISP SETS

103
April 2007
FUZZY SETS

104
April 2007
FUZZY SETS

105
April 2007
FUZZY SETS

106
April 2007
OPERATIONS ON FUZZY SETS

107
April 2007
PROPERTIES OF FUZZY SETS

108
April 2007
PROPERTIES OF FUZZY SETS

109
April 2007
PROPERTIES OF FUZZY SETS

110
April 2007
Thank You

Jan 5, 2013
111

Das könnte Ihnen auch gefallen