Unit 1
Unit 1
Basic of computing
• Biological nervous system is the most important part of many living things, in
particular, human beings.
• There is a part called brain at the center of human nervous system.
• In fact, any biological nervous system consists of a large number of interconnected
processing units called neurons.
• Each neuron is approximately 10m long and they can operate in parallel.
• Typically, a human brain consists of approximately 1011 neurons communicating
with each other with the help of electrical impulses.
• Note that, a biological neuron receives all inputs through the dendrites, sums
them and produces an output if the sum is greater than a threshold value
• The input signals are passed on to the cell body (soma) through the synapse
which may accelerate or retard an arriving signal. It is this acceleration or
retardation of the input signals that is modeled by the weights.
• An effective synapse, which transmits a stronger signal will have a
correspondingly larger weights while a weak synapse will have smaller weights.
• Thus, weights here are multiplicative factors of the inputs to account for the
strength of the synapse.
• Our brain can be considered as a highly complex, nonlinear and parallel information
processing system
• Information is stored and processed in a neural network simultaneously throughout the
whole network rather than at specific locations. In other words, in neural networks, both
data and its processing are global rather than local
• Learning is a fundamental and essential characteristic of biological neural networks. The
ease with which they can learn led to attempts to emulate a biological neural network in
a computer.
• The neuron computes the weighted sum of the input signals and compares the result with a
threshold value ϴ (theta)
• 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 (ϕ)
The simplest neural network architecture giving feedback to itself with a single neuron .
Here, 𝞴 is the steepness parameter. The range of the sigmoid function is from -1 to +1
5. Ramp function: The ramp function is defined as
CSE 412: Principles of Soft Computing 12/02/2024 57
The graphical representation is shown below for all the activation functions
Given inputs x1=0.3, x2=0.5, x3=0.6 and Weights W1=0.2, W2=0.1, W3=-0.3.
Net input yin = x1 W1 + x2 W2 + x3 W3
= 0.3*0.2 + 0.5*0.1 + 0.6*(-0.3)
= 0.06 + 0.05 – 0.18
= 0.11- 0.18
= -0.07
Given x1= 0.8, x2=0.6, x3=0.4 and W1=0.1, W2=0.3 , W3=-0.2 and bias =0.35
The net input of output neutron is
Threshold values is +1
CSE 412: Principles of Soft Computing 12/02/2024 75
McCulloch & Pitts Network - ANDNOT
• Consider the truth table for OR function.
• This network has no particular training algorithm.
• Here only analysis is being performed.
• Hence assume the weights be w1=1 and w2=1
• Well, instead of a line we will have a plane. For the OR function, we want a plane such that
the point (0,0,0) lies on one side and the remaining 7 points lie on the other side of the plane
• A single McCulloch Pitts Neuron can be used to represent Boolean functions which are
linearly separable
• Hebb or Hebbian learning rule comes under Artificial Neural Network (ANN) which is an
architecture of a large number of interconnected elements called neurons. These neurons process the
input received to give the desired output.
• Hebb’s Law can be represented in the form of two rules
1. If two neurons on either side of a connection are activated synchronously then the weight of that
connection is increased.
2. If two neurons on either side of a connection are activated asynchronously, then the weight of
that connection is decreased.
• Hebb’s Law provides the basis for learning without a teacher. Learning here is a local
phenomenon occurring without feedback from the environment.
The weight update in Hebb rule is given by wi (new) = wi (old) + xiy
Hebb’s network is suited more for bipolar data.
HebbCSEnetwork
412: Principles of Soft Computing 12/02/2024
can be used for pattern association, pattern categorization, pattern classification 84
and in
similar areas.
Hebbian Learning In A Neural Network
For all inputs, use the final weights obtained for each input to obtain the separating line. For the first input [1 1
1] , the separating line equation is given by
Similarly, for the second input [1 -1 1], the separating line equation is given by
For the third input [-1 1 1 ], the separating line equation is given by
• The y is computed output and t is desired output . The learning rate 𝛼 ranges from 0 to 1.
Training Algorithm
Given the initial weights and threshold are set to zero, i.e.,
w1 = w2 = b = 0 and θ= 0. The learning rate α is set equal to 1.
For the first input pattern, x1 = l, x2 = 1 and
t = 1, with weights and bias, w1 = 0, w2 = 0 and
b=0,
• Hence weights w1 = 1, w2 = 1 and b =1 are the final weights after first input pattern is
presented.
CSE 412: Principles of Soft Computing 12/02/2024 110
The final weights and bias after second epoch are w1 = 1, w2 = 1, b = -1
Since the threshold for the problem is zero, the equation of the separating line is
Here
It can be easily found that the above straight line separates the positive response and negative response
region,
Initially all the weights and links are assumed to be small random
values, say 0.1, and the learning rare is also set to 0.1. Also, here
the least mean square error may be set. The weights are calculated
until the least mean square error is obtained.
The initial weights are taken to be w1 = w2 = b = 0.1 and the learning rate α = 0.1. For the first input sample, x1
= 1, x2 = 1, t = 1, we calculate the net input as
where α(t- yin)xi is called as weight change Δwi. The new weights are obtained as
where
12/02/2024 122
CSE 412: Principles of Soft Computing
Multiple Adaptive Linear Neuron (MADALINE)
Here,
Here,
Hence
After computing the output of the hidden units, then find the net input entering the output unit:
Apply the activation function over the net input y in to calculate the output y.
Since t ≠ y. weight updation has to be performed. Also, since t = -1, the weights are updated on z 1 and z2 that have positive
net input. Since here both net inputs zin1 and zin2 are positive, updating the weights and bias on both hidden units, we obtain
CSE 412: Principles of Soft Computing 12/02/2024 127
This implies
All the weights and bias between the
input layer and hidden layer are
adjusted. This completes the training
for the first epoch. The same process
is repeated until the weight converges.
It is found that the weight converges
at the end of 3 epochs.
CSE 412: Principles of Soft Computing 12/02/2024 128
CSE 412: Principles of Soft Computing 12/02/2024 129
• The network architecture for Madaline network with final weights for XOR function