Learning Process
Learning Process
Just as there are different ways in which we ourselves learn from our
own surrounding environments, so it is with neural networks. In a broad
sense, we may categorize the learning processes through which neural
networks function as follows: learning with a teacher and learning
without a teacher. By the same token, the latter form of learning may be
subcategorized into unsupervised learning and reinforcement learning.
These different forms of learning as performed on neural networks
parallel those of human learning.
Learning with a teacher
• Learning with a teacher is also referred to as supervised learning.
Figure 24 shows a block diagram that illustrates this form of learning.
In conceptual terms, we may think of the teacher as having
knowledge of the environment, with that knowledge being
represented by a set of input–output examples. The environment is,
however, unknown to the neural network. Suppose now that the
teacher and the neural network are both exposed to a training vector
(i.e., example) drawn from the same environment.
Learning with teacher
• By virtue of built-in knowledge, the teacher is able to provide the
neural network with a desired response for that training vector.
Indeed, the desired response represents the “optimum” action to be
performed by the neural network. The network parameters are
adjusted under the combined influence of the training vector and the
error signal. The error signal is defined as the difference between the
desired response and the actual response of the network. This
adjustment is carried out iteratively in a step-by-step fashion with the
aim of eventually making the neural network emulate the teacher;
the emulation is presumed to be optimum in some statistical sense.
• In this way, knowledge of the environment available to the teacher is
transferred to the neural network through training and stored in the
form of “fixed” synaptic weights, representing Long-term memory.
When this condition is reached, we may then dispense with the
teacher and let the neural network deal with the environment
completely by itself.
• The form of supervised learning we have just described is the basis of
error correction learning.
Learning without a Teacher
Lecture 4-17
Associative Memories
• Motivation
• Human ability to retrieve information from applied associated stimuli
• Example, recalling one’s relationship with another after not seeing them for several years
despite the other’s physical changes (aging, facial hair, etc.)
• Enhances human awareness and deduction skills and efficiently organizes vast amounts
of information
• Why not replicate this ability with computers?
• Ability would be a crucial addition to the Artificial Intelligence Community in developing
rational, goal oriented, problem solving agents
Associative Memory Definition
• In biological terms associative memory refers to the brains
capability to associate different objects, feelings, senses, etc.
with known past experiences.
• Associative recall/retrieve
– evoke associated patterns
– recall a pattern by part of it: pattern completion
– evoke/recall with noisy patterns: pattern correction
Example for Associative recall/retrieve
• Recall a stored pattern by a noisy input
pattern
• Using the weights that capture the
association
• Stored patterns are viewed as
“attractors”, each has its “attraction
basin”
• Often call this type of NN “associative
memory” (recall by association, not
explicit indexing/addressing)
Outlines
Stored Patterns
(x1 , y1 ) i i
2
(x , y ) 2 x y Autoassociative
i i
p
(x , y ) p x y Heteroassociative
i n
x R
yi Rm
Type of Associative memory
Hetero associative Auto associative
A α A A
B β B B
Hetero-association (Different Patterns) Auto-association (Same Patterns)
Niagara
memory
Waterfall
A memory
A
• For two patterns p and t • For two patterns p and t
– hetero-association (p != t) : – auto-association (p = t):
relating two different relating parts of a pattern
patterns with other parts
Models of Associative Memory Networks
A
Hebbian Learning Laws
Hebb’s Rule
If a neuron receives an output from another
neuron, and if both are highly active (both have
same sign), the weight between the neurons
should be strengthened.
where:
y = neuron output
w = weight vector
x = neuron input
where:
µ = learning constant ( positive value that determines
learning rate )
Summary
• Hebbian learning has four features:
1. It is unsupervised
2. It is a local learning rule, meaning that it can be applied to
a network in parallel
3. It is simple and therefore required very little computation
4. It is biological plausible
T=WP
Architecture of Linear
Associator network
learning of Linear Associative memory
• Goal of learning:
to obtain a set of weights wij from a set of training pattern
pairs {p:t}
such that
when P is applied to the input layer, t is computed at the
output layer
Q
wij t j (q ).Pi (q )
q 1
Hebb’s Algorithm for Linear Associate
• Step 0: initialize all weights to 0
1 if yj 0 1 if yj 0
f (yj) OR
f (yj)
0 if yj 0 1 if yj 0
Using outer product
Instead of obtaining W by iterative updates, it can be computed from
the training set by summing the outer product of tq and pq over all Q
samples.
Q
T T
W= t 1 p1 + t 2 p2 + + t Qp TQ =
T
t qpq (Zero Initial
Weights)
q= 1
In this case, Hebb’s Rule is the same as taking the outer product of
the two vectors, outer product of two vectors is a matrix
i 1 i 1
i 1
ti ,n ti ,n Pi ,1 , , ti ,n Pi ,m
Example 1: hetero-associative memory
• 1- Required to build a neural network which will associate the following 4 training samples:
P t
(1 0 0 0) (1, 0)
(1 1 0 0) (1, 0)
input
(0 0 0 1) (0, 1) output
(0 0 1 1) (0, 1)
• 2- Test (recall) the network for : n1
x = (1 0 0 0) n2
x=(0 1 1 0)
x=(0 1 0 0)
Solution: First, Build the network:
1- finding the four outer products
1 1 0 0 0
t1 p 1 0 0 0
T
1
0 0 0 0 0
1 1 1 0 0
t 2 p2 1 1 0 0
T
0 0 0 0 0
0 0 0 0 0
t3 p 0 0 0 1
T
3
1 0 0 0 1
0 0 0 0 0
t 4 p4 0 0 1 1
T
1 0 0 11
2- Add all four individual weight matrices to produce the final weight
matrix:
2 1 0 0 Each row defines
W the weights for an output
0 0 1 2 neuron
Solution, cont.
Recall: Try the first input pattern: x = (1 0 0 0)
1
2 1 0 0 0
y (2 0)
0 0 1 2 0
0
f ( y ) (1 0), a correct recall
Recall: input pattern x=(0 1 1 0)
(not sufficiently similar to any training input)
0
2 1 0 0 1
y (1 1)
0 0 1 2 1
0
f ( y ) (1 1), not a stored pattern
Solution, cont.
1 1 1 1
1 1 1 1
W t. p t p. p t
1 1 1 1
1 1 1 1
Example 2: auto-associative memory, cont.
• Example, cont. :
recall the following patterns:
1 noisy 1 0 0 x=(-1
0 0 not
T
4- Recall ythe
Wmore 1 1 pattern: -1 1recognized
-1)
Illustrate Example 3: Autoassociative Memory
In first image, represent the white pixel with -1 and the black
pixel with 1, then the first row of image can be write as:
-1 1 1 1 -1
and the second row as:
1 -1 -1 -1 1
And so on. Then the input vector p1 will be:
67% Occluded