Module - 2
Module - 2
Brain is trained…
1. Dendrites = Input
2. Nucleus / Soma / Neuron =
processes the information
3. Axon = Output
4. Axon terminals / Synapses = Point
of connection to other neurons
McCULLOCH PITTS NEURON MODEL
• Mankind’s First Mathematical
Model of A Biological Neuron
• Its binary activated
• Output is only 0 or 1
Z= +
Y=f(Z = X1 X2 Y
0 0 0
0 1 0
1 0 0
1 1 1
AND Function using Bipolar inputs
X1 1
Y
x2 Z
x1 X2 1
x2 = 1 – x1
X1 X2 Y
1 1 1
x1 + x2 = z 1 -1 -1
As z = 1 -1 1 -1
x1 + x2 = 1 -1 -1 -1
x2 = 1 – x1
Linearly Separable !!!
Can ..
• The solution be unique ?
• There be a guarantee that solution exits ?
• There be a guarantee that the solution is optimum solution ?
X-OR Function using Bipolar inputs
x2
X1 3
Y
x1 Z
X2 3
X1 X2 Y
1 1 -1
Z = 3x1 + 3x2 1 -1 1
Y=f(Z = 3x1-3x2=1---1
Non Linearly Separable !!! -3x1+3x2=1--2 -1 1 1
-1 -1 -1
What is a Perceptron?
A perceptron is a binary classification algorithm modeled after the functioning of the human
brain
What is Multilayer Perceptron?
• A multilayer perceptron (MLP) is a group of perceptrons, organized in multiple layers, that can
accurately answer complex questions.
• Each perceptron in the first layer (on the left) sends signals to all the perceptrons in the second
layer, and so on.
• An MLP contains an input layer, at least one hidden layer, and an output layer.
The Perceptron Learning Process
• Takes the inputs which are fed into the
perceptrons in the input layer, multiplies them
by their weights, and computes the sum.
Z=
• Adds the number one, multiplied by a “bias
weight”.
Z = + b*1
• This is a technical step that helps the output of
each perceptron to move up, down, left and
right based on this value the activation
function makes a decision. b
• Feeds the sum through the activation function
in a simple perceptron system, the activation
function is a step function.
• The result of the step function is the output. 1
Y=f(Z =
Perceptron Learning Algorithm
• S1 : Initialize weights & Bias (Initially set to 0)
• S2 : Compute the response of the net
X1 w1
• S3 : Apply Activation function
Y
• S4: check for stopping condition : Z
• if false update weight & Bias
• S5 : Repeat S2-S4
X2 w2
Z= b + b
Y=f(Z =
Y = t : where t = target 1 Activation of this
• + unit is always 1
where = *t*
• + Perceptron is the basic unit of the neural network.
where = t*
Accepts an input and generates a prediction.
• Assume
Artificial Neural Network (ANN)
ANN is an information processing system.
Elements called Neurons process the information : Heart of ANN
Neural Net can be single layer or multi-layer (MNN) net
ANN thinks and behaves exactly like human.
It has 2 passes
1. Forward pass
2. Backward pass
Backward pass updates weight
Artificial Neural Networks (ANN)
&
Deep Neural Network (DNN)
• Artificial Neural Networks (ANN) is a supervised learning system built of a large number of
simple elements, called neurons or perceptron's.
• Each neuron makes a simple decisions, and feeds those decisions to other neurons, organized
in interconnected layers.
• Together, the neural network can implement almost any function, and practically answer any
questions, given enough training samples and computing power.
• A “shallow” neural network has only three layers of neurons:
1. An input layer that accepts the independent variables or inputs of the model
2. One hidden layer that connects the input & output layers
3. An output layer that generates predictions
• A Deep Neural Network (DNN) has a similar structure, but it has two or more “hidden layers” of
neurons that process inputs.
• As more number of neuron layers are added, deep learning networks are more accurate, and
also improve in accuracy.
Comparison
Difference between MLP and ANN
•Each image is 28 pixels in height and 28 pixels in width, for a total of 784 pixels in total.
Each pixel has a single pixel-value associated with it, indicating the lightness or darkness of
that pixel, with higher numbers meaning darker. This pixel-value is an integer between 0 and
255.
Continue…
Predict Fashion Classes
http://scs.ryerson.ca/~aharley/vis/conv/flat.html
How to improve model?
Increase filters /Drop outs
Continue
STEP #1: IMPORT LIBRARIES
STEP #2: LOAD DATASET
STEP #3: DATA VISUALIZATION
STEP#4: BUILD AND TRAIN A DEEP LEARNING MODEL
STEP #5: EVALUATE THE MODEL
THANK YOU