0% found this document useful (0 votes)
117 views

Lecture 8 - Supervised Learning in Neural Networks - (Part 1)

This document discusses supervised learning in neural networks. It defines learning algorithms and different types of learning including supervised, unsupervised, reinforcement, and fixed-weight learning. Supervised learning uses input-output patterns to train networks. The perceptron learning rule is described which updates weights based on an error term. A perceptron training algorithm is outlined involving initialization, activation, weight training through a delta rule, and iteration until convergence. An example shows a perceptron learning the logical AND operation.

Uploaded by

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

Lecture 8 - Supervised Learning in Neural Networks - (Part 1)

This document discusses supervised learning in neural networks. It defines learning algorithms and different types of learning including supervised, unsupervised, reinforcement, and fixed-weight learning. Supervised learning uses input-output patterns to train networks. The perceptron learning rule is described which updates weights based on an error term. A perceptron training algorithm is outlined involving initialization, activation, weight training through a delta rule, and iteration until convergence. An example shows a perceptron learning the logical AND operation.

Uploaded by

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

Dr.

Qadri Hamarsheh

Supervised Learning in Neural Networks


(Part 1)
A prescribed set of well-defined rules for the solution of a learning problem is
called a learning algorithm. Variety of learning algorithms are existing, each of
which offers advantages of its own. Basically, learning algorithms differ from
each other in the way in which the adjustment Δwkj to the synaptic weight wkj is
formulated.
Theoretically, a neural network could learn by:
1. Developing new connections.
2. Deleting existing connections.
3. Changing connecting weights, (and practically).
4. Changing the threshold values of neurons, (and practically).
5. Changing activation function, propagation function or output
function.
6. Developing new neurons.
7. Deleting existing neurons.
Fundamentals on learning and training:
 Learning is a process by which the free parameters (weights and biases) of a
neural network are adapted through a continuing process of stimulation by
the environment.
 This definition of the learning process implies the following sequence of
events:
1. The neural network is stimulated by an environment.
2. The neural network is changed (internal structure) as a result of this
stimulation.
3. The neural network responds in a new way to the environment.
Setting the Weights
 The method of setting the values of the weights (training) is an important
characteristic of different neural nets. different types of training:
o Supervised: in which the network is trained by providing it with input
and matching output patterns.
o Unsupervised or Self-organization in which an output unit is trained
to respond to clusters of pattern within the input, the system must
develop its own representation of the input stimuli.
o Reinforcement learning, sometimes called reward-penalty
learning, is a combination of the above two methods; it is based on
presenting input vector x to a neural network and looking at the
output vector calculated by the network. If it is considered "good,"
then a "reward" is given to the network in the sense that the existing

1
Dr. Qadri Hamarsheh

connection weights are increased; otherwise the network is


"punished," the connection weights decreased.
o Nets whose weights are fixed without an iterative training process.
 Supervised learning network paradigms.
 Supervised Learning in Neural Networks: Perceptrons and Multilayer
Perceptrons.
 Training set: A training set (named P) is a set of training patterns, which
we use to train our neural net.
 Batch training of a network proceeds by making weight and bias changes
based on an entire set (batch) of input vectors.
 Incremental training changes the weights and biases of a network as
needed after presentation of each individual input vector. Incremental
training is sometimes referred to as “on line” or “adaptive” training.
 Hebbian learning rule suggested by Hebb in his classic book
Organization of Behavior: The basic idea is that if two units j and k are
active simultaneously, their interconnection must be strengthened, If j
receives input from k, the simplest version of Hebbian learning prescribes
to modify the weight wjk with

Where 𝜸, is a positive constant of proportionality representing the learning


rate.
 Another common rule uses not the actual activation of unit k but the
deference between the actual and desired activation for adjusting the
weights.

in which dk is the desired activation provided by a teacher. This is often


called the Widrow-Hoff rule or the delta rule.
Error-correction learning

Error-correction learning diagram

2
Dr. Qadri Hamarsheh

 Let 𝐝𝐤 (𝐧) denote some desired response or target response for neuron 𝐤 at
time 𝐧. Let the corresponding value of the actual response (output) of this
neuron be denoted by 𝐲𝐤 (𝐧).
 Typically, the actual response 𝐲𝐤 (𝐧) of neuron 𝐤 is different from the
desired response 𝐝𝐤 (𝐧). Hence, we may define an error signal
𝐞𝐤 (𝐧) = 𝐲𝐤 (𝐧) − 𝐝𝐤 (𝐧)
 The ultimate purpose of error-correction learning is to minimize a cost
function based on the error signal 𝐞𝐤 (𝐧).
 A criterion commonly used for the cost function is the instantaneous value
of the mean square-error criterion

 The network is then optimized by minimizing 𝐉(𝐧) with respect to the


synaptic weights of the network. Thus, according to the error-correction
learning rule (or delta rule), the synaptic weight adjustment is given by

 Let wkj(n) denote the value of the synaptic weight wkj at time n. At time n an
adjustment Δwkj(n) is applied to the synaptic weight wkj(n), yielding the
updated value
wkj (n +1) = wkj (n) + Δwkj (n)
The perceptron’ training algorithm
The Perceptron Learning Rule
 Perceptrons are trained on examples of desired behavior, which can be
summarized by a set of input-output pairs
{𝒑𝟏, 𝒕𝟏}, {𝒑𝟐, 𝒕𝟐}, … , {𝒑𝑸, 𝒕𝑸}
 The objective of training is to reduce the error e, which is the difference
𝒕 – 𝒂 between the perceptron output 𝒂, and the target vector 𝒕.
 This is done by adjusting the weights (W) and biases (b) of the perceptron
network according to following equations
𝐖𝐧𝐞𝐰 = 𝐖𝐨𝐥𝐝 + 𝚫𝐖 = 𝐖𝐨𝐥𝐝 + 𝐞𝐏 𝐓
𝐛𝐧𝐞𝐰 = 𝐛𝐨𝐥𝐝 + 𝚫𝐛 = 𝐛𝐨𝐥𝐝 + 𝐞
Where
𝐞 = 𝐭– 𝐚

3
Dr. Qadri Hamarsheh

 Diagram of a neuron:

 The neuron computes the weighted sum of the input signals and compares
the result with a threshold value, 𝜽. If the net input is less than the threshold,
the neuron output is –1. But if the net input is greater than or equal to the
threshold, the neuron becomes activated and its output attains a value +1.
 The neuron uses the following transfer or activation function:

Single neuron’ training algorithm


 In 1958, Frank Rosenblatt introduced a training algorithm that provided the
first procedure for training a simple ANN: a perceptron.
Single-layer two-input perceptron

The Perceptron
 The operation of Rosenblatt’s perceptron is based on the McCulloch and
Pitts neuron model. The model consists of a linear combiner followed by a
hard limiter.
 The weighted sum of the inputs is applied to the hard limiter, which
produces an output equal to +1 if its input is positive and -1 if it is negative.
 The aim of the perceptron is to classify inputs, x1, x2, . . ., xn, into one of
two classes, say A1 and A2.
 In the case of an elementary perceptron, the n- dimensional space is
divided by a hyperplane into two decision regions. The hyperplane is
defined by the linearly separable function:

4
Dr. Qadri Hamarsheh

Linear separability in the perceptrons

How does the perceptron learn its classification tasks?


 This is done by making small adjustments in the weights to reduce the
difference between the actual and desired outputs of the perceptron. The
initial weights are randomly assigned, usually in the range [-0.5, 0.5], and
then updated to obtain the output consistent with the training examples.
 If at iteration p, the actual output is Y(p) and the desired output is Yd (p), then
the error is given by:

where p = 1, 2, 3, . . .
Iteration p here refers to the pth training example presented to the perceptron.
 If the error, e(p), is positive, we need to increase perceptron output Y(p), but
if it is negative, we need to decrease Y(p).
The perceptron learning rule

where p = 1, 2, 3, . . .
 𝜶 is the learning rate, a positive constant less than unity.
 The perceptron learning rule was first proposed by Rosenblatt in 1960.
Using this rule we can derive the perceptron training algorithm for
classification tasks.

5
Dr. Qadri Hamarsheh

Perceptron’s training algorithm


Step 1: Initialization
Set initial weights w1, w2,…, wn and threshold 𝜽 to random numbers in the range
[-0.5, 0.5].
Step 2: Activation
Activate the perceptron by applying inputs x1(p), x2(p),…, xn(p) and desired
output Yd (p).
Calculate the actual output at iteration p = 1

Where n is the number of the perceptron inputs, and step is a step activation
function.
Step 3: Weight training
Update the weights of the perceptron

where ∆𝒘𝒊 (𝒑) is the weight correction at iteration p.

The weight correction is computed by the delta rule:


Step 4: Iteration
Increase iteration p by one, go back to Step 2 and repeat the process until
convergence.
Example of perceptron learning: the logical operation AND

(a) AND (x1 


x2)

6
Dr. Qadri Hamarsheh

Two-dimensional plots of basic logical operations


A perceptron can learn the operations AND and OR, but not Exclusive-OR.

You might also like