19 - Introduction To Neural Networks
19 - Introduction To Neural Networks
19 - Introduction To Neural Networks
20 - The Perceptron
Perceptron
Developed by Frank Rosenblatt by using McCulloch and Pitts model,
perceptron is the basic operational unit of artificial neural networks. It
employs supervised learning rule and is able to classify the data into two
classes.
Operational characteristics of the perceptron: It consists of a single neuron
with an arbitrary number of inputs along with adjustable weights, but the
output of the neuron is 1 or 0 depending upon the threshold. It also consists
of a bias whose weight is always 1. Following figure gives a schematic
representation of the perceptron.
Perceptron thus has the following three basic elements −
Links − It would have a set of connection links, which carries a weight
including a bias always having weight 1.
Adder − It adds the input after they are multiplied with their respective
weights.
Activation function − It limits the output of neuron. The most basic
activation function is a Heaviside step function that has two possible
outputs. This function returns 1, if the input is positive, and 0 for any
negative input.
Training Algorithm
Perceptron network can be trained for single output unit as well as multiple
output units.
Training Algorithm for Single Output Unit
Step 1 − Initialize the following to start the training −
Weights
Bias
Learning rate α
For easy calculation and simplicity, weights and bias must be set equal to 0
and the learning rate must be set equal to 1.
Step 2 − Continue step 3-8 when the stopping condition is not true.
Step 3 − Continue step 4-6 for every training vector x.
Step 4 − Activate each input unit as follows −
xi=si(i=1ton)
Step 5 − Now obtain the net input with the following relation −
yin=b+∑(i se n tak ) xi.wi
Here ‘b’ is bias and ‘n’ is the total number of input neurons.
Step 6 − Apply the following activation function to obtain the final output.
During feedforward, each input unit (Xi) receives an input signal and sends this
signal to each of the hidden units Z1, Z2, …Zj. Each hidden unit computes its
activation and sends its signal to each output unit. Each output unit computes
its activation to compute the output or the response of the neural net for the
given input pattern.
Algorithm
Feed forward
Step 4: Input unit receives input signal and propagates it to all units in the
hidden layer
Step 6: Each output unit sums its weighted input signals and applied its
activation function to compute its output signal.
Backpropagation
Step 7: Each output unit receives a target pattern corresponding to the input
training pattern, computes its error information term
δk = ( tk – yk) f’ (y_ink)
Step 8: Each hidden unit sums its delta inputs ∑ =− = m k jkkj win 1 δδ
Calculates its weight correction term ∆vij = αδjxi And calculates its bias
correction term ∆voj = αδj Update weights and biases
22 - Training Procedures
2. A CNN uses a system much like a multilayer perceptron that has been
designed for reduced processing requirements.
Convolution Layer
The convolution layer is the core building block of the CNN. It carries the
main portion of the network’s computational load. This layer performs a
dot product between two matrices, where one matrix is the set of
learnable parameters otherwise known as a kernel, and the other matrix is
the restricted portion of the receptive field. The kernel is spatially smaller
than an image, but is more in-depth. This means that, if the image is
composed of three (RGB) channels, the kernel height and width will be
spatially small, but the depth extends up to all three channels.
Pooling Layer
The pooling layer replaces the output of the network at certain locations
by deriving a summary statistic of the nearby outputs. This helps in
reducing the spatial size of the representation, which decreases the
required amount of computation and weights. The pooling operation is
processed on every slice of the representation individually.