Unit2 Soft Computing
Unit2 Soft Computing
1
Perception networks
Theory
Perception networks come under single-layer feed-forward
networks and are also called simple perceptrons.
The key points to be noted in a perceptron network are:
2. The sensory units are connected to associator units with fixed weights
having values 1, 0 or -l, which areassigned at random.
4. The response unit has an activation of l, 0 or -1. The binary step with
fixed threshold ɵis used asactivation for associator. The output signals
that are sent from the associator unit to the response unit areonly binary.
2
7. The error calculation is based on the comparison of values of targets
with those of the calculatedoutputs.
8. The weights on the connections from the units that send the nonzero
signal will get adjusted suitably.
Sensory unit
3
A sensory unit can be a two-dimensional matrix of 400 photo
detectors upon which a lighted picture with geometric blackand white
pattern impinges. These detectors provide a binary(0) electricalsignal if
the input signal is found to exceed acertain value of threshold. Also,
these detectors are connected randomly with the associator unit.
Associator unit
The associator unit is found to consist of a set ofsubcircuits called
feature predicates. The feature predicates arehard-wired to detect the
specific feature of a pattern and are equivalent to the feature detectors.
For a particularfeature, each predicate is examined with a few or all of
the responses of the sensory unit. It can be found thatthe results from the
predicate units are also binary (0 or 1).
Response unit
The last unit, i.e. response unit, contains thepatternrecognizers or
perceptrons. The weights presentin the input layers are all fixed, while
the weights onthe response unit are trainable.
Learning rule
In case of the perceptron learning rule, the learning signal is the
difference between the desiredandactual response of a neuron. The
perceptron learning rule is explained as follows:
Consider a finite "n" number of input training vectors, with their
associated targetvalues x(n)and t{n), where "n" ranges from 1 toN. The
target is either+ 1 or -1. The output ''y" is obtained on thebasis of the net
input calculated and activation function being applied over the net input.
4
If y≠ tthen
else
Architecture
A simple perceptron network architecture is shown inFigure
below:
5
6
The flowchart depicted here presents the flow of the training
process.As depicted in the flowchart, first the basic initialization
required for the training process is performed.
The entire loop of the training process continues until the training
input pair is presented to the network. The training (weight updation) is
done on the basis of the comparison between the calculated and desired
output. The loop is terminated if there is no change in weight.
Step 0:Initialize the weights and the bias. Also initialize the learning
rate α(O <α ≤1). For simplicity α is set to 1.
Step 1:Perform Steps 2-6 until the final stopping condition is false.
Step 2: Perform Steps 3-5 for each training pair indicated by s:t.
Step 3: The input layer containing input units is applied with identity
activation functions:
7
Step 4: Calculate the output of the network. To do so, first obtain the net
input:
Step 5:Weight and bias adjustment: Compare the value of the actual
(calculated) output and desired(target) output.
Step 6: Train the network until there is no weight change. This is the
stopping condition for the network.If this condition is not met, then start
again from Step 2.
8
xi=si
Step 4:Calculate output response of each output unit j=1 to m; First the
net input is calculated as:
Then activations are applied over the net input to calculate the output
response:
9
Perceptron Network Testing Algorithm
The testing algorithm is asfollows:
Step 0: The initialweights to be used here are taken from the training
algorithms.
Step 1: For each input vector X to be classified, perform Steps 2-3.
Step 2: Set activations of the input unit.
Step 3: Obtain the response of output unit.
10
Adaptive Linear Neuron (Adaline)
Theory
The units with linear activation function are called linear units. A
network with a single linear unit is calledan Adaline (adaptive linear
neuron). That is, in an Adaline, the input-output relationship is linear.
Adalineusesbipolar activation for its input signals and its target
output. The weights between the input and theoutput are adjustable. The
bias in Adaline acts like an adjustable weight, whose connection is from
a unitwith activations being always 1. Adaline is a net which has only
one output unit. The Adaline network maybe trained using delta rule.
The delta rule may also be called as least mean square (LMS) rule
or Widrow-Hoffrule. This learning rule is found to minimize the mean-
squared error between the activation and the targetvalue.
Delta Rule for Single Output Unit
The Widrow-Hoff rule is very similar to perceptron learning rule.
The delta rule updates the weights between the connections so as
tominimize the difference between the net input to the output unit and
the target value. The major aim is tominimize the error over all training
patterns. This is done by reducing the error for each pattern, one at a
time.
The delta rule for adjusting the weight of ith pattern {i = 1 to n) is
where
is the weight change
α the learning rate
xthe vector of activation of input unit
yinthe net inputto output unit
11
Architecture
Adaline is a single-unitneuron, which receives input from several
units and also from oneunit called bias. An Adaline model is shown in
Figure below:
Step 0: Weights and bias are set to some random values but not zero. Set
the learning rate parameter α.
Step 1: Perform Steps 2-6 when stopping condition is false.
Step 2: Perform Steps 3-5 for each bipolar training pair s: t.
Step 3: Set activations for input units i= 1 to n.
Testing Algorithm
It is essential to perform the resting of a network that has been
trained. When training is completed, theAdaline can be used to classify
input patterns.
A step function is used to test the performance of the network.The
resting procedure for the Adaline network is as follows:
14
Step 4: Apply the activation function over the net input calculated:
16
Training algorithm
Flowchart for Training Process
The flowchart for the training process using a BPN is shown in Figure
below. The terminologies used in theflowchart and in the training
algorithm are as follows:
andthe output is
andthe output is
17
18
19
Training Algorithm
Step 3: Each input unit receives input signal x; and sends it to the
hidden unit (i = l to n).
Step 4: Each hidden unit zj(j = 1 top) sums its Weighted input signals to
calculate net input:
and send the output signal from the hidden unit to the input of output
layer units.
Step 5: For each output unit yk(k = 1 to m),calculate the net input:
Step 7: Each hidden unit (zj,j= 1 top) sums its delta inputs from the
output units:
On the basis of the calculated δj, update the changein weights and
bias:
Step 8: Each output unit (yk, k = 1 tom) updates the bias and weights:
Each hidden unit (zj,j= 1 top) updates its bias and weights:
Step 9: Check for the stopping condition. The stopping condition may
be certain number of epochsreached or when the actual output equals the
target output.
The above algorithm uses the incremental approach for updation of
weights, i.e., the weights are beingchanged immediately after a training
pattern is presented. There is another way of training called batch-mode
training, where the weights are changed only after all the training
patterns are presented. The effectiveness of two approaches depends on
the problem, but batch-mode training requires additional local storage
21
for eachconnection to maintain the immediate weight changes. When a
BPN is used as a classifier, it is equivalent tothe optimal Bayesian
discriminant function for asymptotically large sets of statistically
independent trainingpatterns.
22