Ai - Unit 5 - PPT - MMB
Ai - Unit 5 - PPT - MMB
Ai - Unit 5 - PPT - MMB
ARTIFICIAL INTELLIGENCE
UNIT 5: LEARNING
TEXTBOOKS
1. Artificial Intelligence A Modern Approach, Stuart Russell and Peter Norvig, 3rd
Edition, Pearson Education
2. Artificial Intelligence, Kevin Knight, Elaine Rich, B. Shivashankar Nair, 2nd
Edition, 2008
3. Artificial Neural Networks, B. Yagna Narayana, PHI
https://people.engr.tamu.edu/guni/csce421/files/AI_Russell_Norvig.pdf
2nd/3rd edition
1
6/29/2024
UNIT-5: CONTENTS
LEARNING:::::
• What is learning
• Learning by Taking Advice
• Learning in Problem-solving
• Learning from example: induction
• Explanation-based learning(EBL)
• Introduction to Neural Networks
• Different types of Learning in Neural Networks
• Applications of Neural Networks
• Recurrent Networks
WHAT IS LEARNING?
• Learning is the improvement of performance with experience over time.
• The learning element is the portion of a learning AI system that decides how to
modify the performance element and implements those modifications.
• All will learn new knowledge through different methods, depending on the type of
material to be learned, the amount of relevant expertise already possessed, and
the environment in which the learning takes place.
2
6/29/2024
WHAT IS LEARNING?
Learning by taking advice
• Initial state: high-level advice
• Final state: an operational rule
• Operators: unfolding definitions, case analysis, matching, etc.
Learning from examples
• Initial state: collection of positive and negative example
• Final state: concept description
• Search algorithms: candidate elimination. induction of decision trees
Learning in problem-solving
• Initial state: solution traces to example problems
• Final state: new heuristics for solving new problems efficiently
• Heuristics for search: generalization, explanation-based learning. utility consideration
Discovery
• Initial state: some environment
• Final state: unknown
• Heuristic for search: interestingness, analogy. etc.
3
6/29/2024
4
6/29/2024
5
6/29/2024
6
6/29/2024
7
6/29/2024
LEARNING IN PROBLEM-SOLVING
Learning by Parameter Adjustment
• In a static evaluation function, the program used a polynomial form
• The t terms are the values of the sixteen features contributing to the evaluation. The c terms are
the coefficients (weights) that are attached to each of these values.
• As learning progresses, the c values_ will change.
The most important question in the design of a learning program based on parameter adjustment is
1. "When should the value of a coefficient be increased and when should it be decreased?
2. "By how much should the value be changed?"
Question 1: The coefficients of terms that predicted the outcome should be increased, while the
coefficients of poor predictors should be decreased.
Question 2: Until system performance reaches the highest.
• In some domains, this is easy to do.
• In pattern classification programs, the coefficient can increase based on correct predictions.
• In game-playing programs, it is not decided until the end of the game.
LEARNING IN PROBLEM-SOLVING
Learning with Macro-Operators
• Sequences of actions that can be treated as a whole are called Macro-operations.
• Example: START-CAR is an automatic action, even though it consists of several actions
as macro operators like sitting down, adjusting the mirror, inserting the key, and turning
the key.
• Macro-operators were used in the early problem-solving system, STRIPS having a
learning component.
• After each problem-solving episode, the learning component takes the computed plan
and stores it as a macro-operator, or MACROP.
• A MACROP consists of a sequence of actions, not a single one.
• A MACROP's preconditions are the initial conditions of the problem just solved, and its
postconditions correspond to the goal just achieved.
• In its simplest form, the previously computed plans are similar to rote learning.
8
6/29/2024
LEARNING IN PROBLEM-SOLVING
Learning with Macro-Operators (cont…)
• Suppose, given an initial blocks world situation,ON(C, B) and ON(A, Table) are both true.
• STRIPS can achieve the goal ON(A, B) by devising a plan with the four steps
UNSTACK(C, B), PUTDOWN(C), PICKUP(A), STACK(A, B).
• STRIPS now builds MACROP with preconditions ON(C, B), ON(A,Table) and
postconditions ON(C, Table), ON(A, B).
• The STRIPS can generalize the plan consists of the steps UNSTACK(x1, x2),
PUTDOWN(x1), PICKUP(x3), STACK(x3, x2), where xI, x2, andx3 are variables.
• This plan can then be stored with preconditions ON(x1, x2), ON(x3, Table) and
postconditions ON(x1, Table), ON(x2, x3).
• Such a MACROP can now apply in a variety of situations.
LEARNING IN PROBLEM-SOLVING
Learning with Macro-Operators(cont…)
• Suppose our domain included an operator called STACK-ON-B(x), with preconditions that both x
and B be clear, and with postcondition ON(x, B). Consider the same problem as above:
• STRIPS might come up with the plan UNSTACK(C, B), PUTDOWN(C), STACK-ON-B(A).
• Let’s generalize this plan and store it as a MACROP.
• The precondition becomes ON(x3, x2), the postcondition becomes ON(x1, x2), and the plan itself
becomes UNSTACK(x3, x2), PUTDOWN(x3), STACK-ON-B(x1).
• The generalized MACROP, Let x1 = A, x2 = C, and x3= E. Its preconditions are satisfied, so we
construct the plan UNSTACK(E, C), PUTDOWN(E), STACK-ON-B(A).
• But this plan does not work. The problem is that the postcondition of the MACROP.
9
6/29/2024
LEARNING IN PROBLEM-SOLVING
Learning with Macro-Operators (cont…)
• In reality, STRIPS uses a more complex generalization procedure.
• First, all constants are replaced by variables.
• Then, for each operator in the parameterized plan, STRIPS revaluates its preconditions.
• In our example, the preconditions of steps l and 2 are satisfied, but the only way to
ensure that B is clear for step 3 is to assume that block x2, using the UNSTACK operator,
is block B.
• Through "re proving'· that the generalized plan works, STRIPS locates constraints of this
kind.
• Macro-operators are critical and suitable for nonserializable subgoals.
• Nonserializability means that working on one subgoal will not necessarily interfere with
the previous solution to another subgoal.
• Macro-operators can be useful in such cases since one macro-operator can produce a
small global change in the world, even though the individual operators that make it up
produce many undesirable local changes.
LEARNING IN PROBLEM-SOLVING
Learning by Chunking
• Chunking is a process similar to macro-operators.
• The idea of chunking comes from the psychological literature on memory and problem-
solving.
• Its computational basis is in production systems, of the type SOAR system.
• SOAR exploits chunking, so that its performance can increase with experience.
• In fact, the designers of SOAR hypothesize that chunking is a universal learning method,
i.e., it can account for all types of learning in intelligent systems.
• SOAR solves problems by firing productions, which are stored in long-term memory.
• Some of those firings turn out to be more useful than others.
• When SOAR detects a useful sequence of production firings, it creates a chunk, which is
essentially a large production that does the work of an entire sequence of smaller ones.
As in MACROPs, chunks are generalized before they are stored.
• Chunks are used to learn general search control knowledge in addition to operator
sequences.
10
6/29/2024
LEARNING IN PROBLEM-SOLVING
Learning by Chunking(cont…)
For example, if SOAR tries several different operators, but only one leads to a useful path in the
search space, then SOAR builds productions that help it choose operators more wisely in the future.
Use chunking to replicate the macro-operator results. In solving the 8-puzzle,
• SOAR learns how to place a given tile without disturbing the previously placed tiles.
• Several chunks may encode a single macro-operator, and one chunk may participate in several
macro sequences.
• Chunks are generally applicable toward any goal state. This contrasts with macro tables, which
are structured toward reaching a particular goal state from any initial state.
• Also, chunking emphasizes how learning can occur during problem-solving, while macro tables
are usually built during a preprocessing stage.
• As a result, SOAR can learn within trials as well as across trials.
• Chunks learned during the initial stages of solving a problem are applicable in the later stages of
the same problem-solving episode. After a solution is found, the chunks remain in memory, ready
for use in the next problem.
• The price that SOAR pays for this generality and flexibility is high.
• Chunking is inadequate for duplicating the contents of large, directly-computed macro-operator
tables.
11
6/29/2024
12
6/29/2024
13
6/29/2024
• The choice of features and values is called the bias of a learning system.
• A clear statement of the bias of a learning system is important to its evaluation.
14
6/29/2024
15
6/29/2024
16
6/29/2024
17
6/29/2024
• It is then monitored during subsequent problem-solving. If its utility falls, the rule
is discarded.
• Empirical experiments have demonstrated the effectiveness of keeping only those
control rules with high utility.
• Utility considerations apply to a wide range of learning systems.
EXPLANATION-BASED LEARNING
Consider a chess player who, as Black, has reached the
position shown in Fig. 17.14. The position is called a "fork"
because the white knight attacks both the black king and
the black queen. Black must move the king, thereby leaving
the queen open to capture.
• From this single experience, Black is able to learn quite a bit about the fork trap:
• the idea is that if any piece x attacks both the opponent's king and another piece
y, then piece y will be lost.
• We don't need to see dozens of positive and negative examples of fork positions
in order to draw these conclusions.
• From just one experience, we can learn to avoid this trap in the future and
perhaps to use it to our own advantage.
18
6/29/2024
EXPLANATION-BASED LEARNING
What makes such single-example learning possible? The answer is knowledge.
• The chess player has plenty of domain-specific knowledge that can be brought to bear, including
me rules of chess and any previously acquired strategies.
• That knowledge can be used to identify critical aspects of the training example.
• In the case of the fork, we know that the double simultaneous attack is important while the precise
position and type of the attacking piece is not.
Explanation-based Leaning (EBL) system attempts to learn from a single example x by explaining
why x is an example of the target concept.
The explanation is then generalized, and the system's performance is improved through the
availability of this knowledge.
• EBL programs as accepting the following as input:
• A Training Example-What the learning program "sees" in the world, e.g., the car of Fig. 17.7
• A Goal Concept-A high-level description of what the program is supposed to learn
• An Operationally Criterion-A description of which concepts are usable
• A Domain Theory-A set of rules that describe relationships between objects and actions in a
domain
EXPLANATION-BASED LEARNING
EBL has two steps: (1) explain and (2) generalize.
Step1: Explain, the domain theory is used to prune away all the unimportant aspects of the
training example with respect to the goal concept.
• What is left is an explanation of why the training example is an instance of the goal
concept.
• This explanation is expressed in terms that satisfy the operationality criterion.
Step 2: generalize, the explanation as far as possible while still describing the goal concept.
Example - chess,
Step1: Ignore White’s pawns, king, and rook, and constructs
Explain: White's knight, Black's king, and Black's queen. each in their specific positions.
Operationality is ensured: all chess-playing programs understand the basic concepts of
piece and position.
Next, the explanation is generalized. Using domain knowledge, moving the pieces to a
different part of the board is bad for Black.
Also determine that other pieces besides knights and queens can participate in fork attacks.
19
6/29/2024
Training Example:
owner(Object23, Ralph) ∧ has-
part(Object23, Concavityl2) ∧ is(Object23,
Light) ∧ color(Object23, Brown) ∧ ...
Domain Knowledge:
isa(x, Light) ∧ has-part(x, y) ∧ isa(y. Handle)
➔ liftable(x)
has-part(x, y) ∧ isa(y, Bottom) ∧ is(y, Flat) ➔
stable(x) description of a cup:
has-part(x, y) ∧ isa(y, Concavity) ∧ is(y, has-part(x, y) ∧ isa(y, Concavity) ∧ is(y,
Upward-Pointing) ➔ open-vessel(x)
Upward-Pointing) ∧ has-part(x, z) ∧ isa(z,
Goal Concept: Cup Bottom) ∧ is(z, Flat) ∧ has-part(x, w) ∧ isa(w,
x is a Cup if x is liftable, stable, and open- Handle) ∧ isa(w, Light)
vessel.
DISCOVERY
• Discovery is a restricted form of learning in which one entity acquires knowledge without
the help of a teacher.
• Automated discovery systems are:
• AM: Theory-Driven Discovery
• BACON: Data-Driven Discovery
• Clustering
20
6/29/2024
DISCOVERY
AM: Theory-Driven Discovery
• AM, worked from a few basic concepts of set theory to discover a good deal of standard number theory.
• AM exploited a variety of general-purpose AI techniques.
• It used a frame system to represent mathematical concepts.
• One of the major activities of AM is to create new concepts and fill in their slots.
AM Heuristics
• BACON: Data-Driven Discovery • If t is a function from A to Band Bis ordered, then
• Clustering consider the elements of A that are mapped into
extremal elements of B. Create a new concept
representing this subset of A.
• If some (but not most) examples of some concept X
are also examples of another concept Y, create a
new concept representing the intersection of X and Y
• If very few examples of a concept X are found, then
add to the agenda the task of finding a generalization
of X.
21
6/29/2024
DISCOVERY
Clustering
• It is very similar to induction, In inductive learning, a program learns to classify
objects based on the labelings provided by a teacher.
• In clustering, no class labelings are provided.
• The program must discover for itself the natural classes that exist for the
objects, in addition to a method for classifying instances.
ANALOGY
Analogy is a powerful inference tool.
Our language and reasoning are laden with analogies.
Consider the following sentences:
• Last month, the stock market was a roller coaster.
• Bill is like a fire engine.
• Problems in electromagnetism are just like problems in fluid flow.
22
6/29/2024
ANALOGY
Transformational Analogy –
Example, points and line segments
A proof that the line segment RN is exactly as long as the line segment
OY, given that RO is exactly as long as NY.
ANALOGY-DERIVATIONAL ANALOGY
• Derivational analogy is a necessary component in the
transfer of skills in complex domains.
• For example, coded sorting routine in Pascal, and
then to recode the routine in LISP.
• A line-by-line translation is inappropriate, but reuse the
major structural and control decisions done in the old
solution, and construct in the Pascal program.
• One way to model this behavior is to have a problem-solver "replay" the previous derivation and
modify it when necessary.
• If the original reasons and assumptions for a step's existence remain in the new problem, the step
is copied over.
• If some assumption is no longer valid, another assumption must be found.
• If one cannot be found, then we can try to find justification for some alternative stored in the
derivation of the original problem.
• Or perhaps try some step marked as leading to search failure in the original derivation, if the
reasons for failure conditions are not valid in the current derivation.
23
6/29/2024
24
6/29/2024
• Perceptron
• Back Propagation
• Generalization
• Boltzmann Machines
• Reinforcement Learning
• Unsupervised Learning
• The Kohonen Neural Network Model
25
6/29/2024
26
6/29/2024
27
6/29/2024
28
6/29/2024
29
6/29/2024
5. Propagate the activations from the units in the input layer to the hidden layer using the activation
function:
Note that i ranges from O to A {w10j is the thresholding weight for hidden unit} (its propensity to fire
irrespective of its inputs). x0 is always 1.0.
6. Propagate the activations from the units in the hidden layer to the unit in the output layer.
30
6/29/2024
31
6/29/2024
where wj is the weight on the connection from input unit j to the active output unit, xj is the value of
the jth input bit, m is the number of input units that are active in the input vector that was chosen in
step 1.
and is the learning rate (some small constant). It is easy to show that if the weights on the
connections feeding into an output unit sum to 1 before the weight change, then they will still sum to I
afterward.
5. Repeat steps l to 4 for all input patterns for many epochs.
32
6/29/2024
33
6/29/2024
The Kohonen neuron having the least distance is referred as the winning neuron.
4. Modify the weights of all neurons in the neighborhood of radius r of the winning neuron using :
Note that this modification results in the winning neuron and its neighbours to move closer to
(learn) the input. Naturally if the learning rate a were unity the neurons would converge on the
input. For all other neurons the weights remain unaltered.
5. Update α by reducing it gradually over the iterations. This reduces the rate at which the neurons
converge on the input.
6. Reduce the neighbourhood radius r gradually at specified iterations.
Problems:::
• Connectionist Speech
• Connectionist Vision
• Combinatorial Problems
34
6/29/2024
35
6/29/2024
36