DL_Unit I
DL_Unit I
INTRODUCTION TO NEURAL
NETWORK
Final Year
BTECH Subject : Deep Learning (PE4)
Unit I : Contents
2
Sources:
• https://www.javatpoint.com/artificial-neural-network
• Introduction to Artificial Neural Systems by Jacek M. Zurada
Yegnanarayana B, Artificial Neural Systems , PHP learning
Final Year
BTECH Subject : Deep Learning (PE4)
What is Machine Learning?
4
https://www.javatpoint.com/artificial-neural-network
What is Artificial Neural Network?
⮚ ANN example-
Consider an example of a digital logic gate that takes an input and
gives an output. "OR" gate, which takes two inputs. If one or both
the inputs are "On," then we get "On" in output. If both the inputs
are "Off," then we get "Off" in output. Here the output depends
upon input. Our brain does not perform the same task. The outputs
to inputs relationship keep changing because of the neurons in our
brain, which are "learning."
Relationship between Biological neural network and
artificial neural network
8
Dendrites Inputs
Synapse Weights
Axon Output
The typical Artificial Neural Network looks something like the given figure.
Input Layer:
◻ As the name suggests, it accepts inputs in several different formats provided
by the programmer.
Hidden Layer:
◻ The hidden layer presents in-between input and output layers. It performs all
the calculations to find hidden features and patterns.
Output Layer:
◻ The input goes through a series of transformations using the hidden layer,
which finally results in output that is conveyed using this layer.
12
Need of Bais
13
Layers of Artificial Neural Network
14
⮚ The artificial neural network takes input and computes the weighted sum of
the inputs and includes a bias. This computation is represented in the form of
a transfer function.
⮚ It determines weighted total is passed as an input to an activation function to
produce the output. Activation functions choose whether a node should fire
or not. Only those who are fired make it to the output layer.
⮚ There are distinctive activation functions available that can be applied upon
the sort of task we are performing.
Types/Models of ANN Architecture
15
Feedforward Network
Feedback Network
Introduction to Artificial Neural Systems by Jacek M. Zurada Yegnanarayana B, Artificial Neural Systems , PHP learning. (Page no. 37)
Types/Models of ANN Architecture
Feedforward Network
16
Figure 2.8(b) shows the block diagram of the feedforward network. As can be seen, the
generic feedforward network is characterized by the lack of feedback. This type of
network can be connected in cascade to create a multilayer network. In such a network,
the output of a layer is the input to the following layer. Even though the feedforward
network has no explicit feedback connection when x(t) is mapped into o(t), the output
values are often compared with the "teacher's" information, which provides the desired
output value, and also an error signal can be employed for adapting the network's
weights.
Introduction to Artificial Neural Systems by Jacek M. Zurada Yegnanarayana B, Artificial Neural Systems , PHP learning. (Page no. 37)
Types/Models of ANN Architecture
Feedback Network
17
A feedback network can be obtained from the feedforward network shown in Figure
2.8(a) by connecting the neurons' outputs to their inputs. The result is depicted in Figure
2.10(a).
Introduction to Artificial Neural Systems by Jacek M. Zurada Yegnanarayana B, Artificial Neural Systems , PHP learning. (Page no. 42)
Advantages of Artificial Neural Network (ANN)
18
⮚ Hardware dependence:
Artificial neural networks need processors with parallel processing power, as per their structure.
Therefore, the realization of the equipment is dependent.
Introduction to Artificial Neural Systems by Jacek M. Zurada Yegnanarayana B, Artificial Neural Systems ,
PHP learning. (Page no. 3-8)
1.1 Neural Computation (With Example)
21
Assume that a set of eight points, Po, P1, . . . , P7, in three-dimensional space is available.
The set consists of all vertices of a three-dimensional cube as follows:
Elements of this set need to be classified into two categories. The first category is defined
as containing points with two or more positive ones; the second category contains all the
remaining points that do not belong to the first category. Accordingly, points P3, P5, P6,
and P7 belong to the first category, and the remaining points to the second category.
Classification of points P3, P5, P6, and P7 can be based on the summation of coordinate
values for each point evaluated for category membership. Notice that for each point Pi (x,,
x2, x3), where i = 0, . . . , 7, the membership in the category can be established by the
following calculation:
The unit from Figure 1 .l(a) maps the entire three-dimensional space into just two points, 1
and - 1. A question arises as to whether a unit with a "squashed" sgn function rather than a
regular sgn function could prove more advantageous. Assuming that the "squashed" sgn
function has the shape as in Figure 1.2, notice that now the outputs take values in the range (-
1,l) and are generally more discernible than in the previous case. Using units with continuous
characteristics offers tremendous opportunities for new tasks that can be performed by neural
networks. Specifically, the fine granularity of output provides more information than the
binary f 1 output of the thresholding element.
Introduction to Artificial Neural Systems by Jacek M. Zurada Yegnanarayana B, Artificial Neural Systems , PHP learning. (Page no. 3-8)
Perceptron, Sigmoid Neurons
Sources:
Final Year
BTECH Subject : Deep Learning (PE4)
Perceptron
24
Michael A. Nielsen, "Neural Networks and Deep Learning", Determination Press, 2015 (Module I- Perceptron, Sigmoid Neurons)
How do perceptron's work?
25
https://www.simplilearn.com/what-is-perceptron-tutorial
Perceptron-Single layer
28
⮚ Perceptron is a function that maps its input “x,” which is multiplied with
the learned weight coefficient; an output value ”f(x)”is generated.
⮚ E.g.
◻ Bias Unit
◻ For simplicity, the threshold θ can be brought to the left and represented as
w0x0, where w0= -θ and x0= 1.
⮚ Output
⮚ The figure shows how the decision function squashes wTx to
either +1 or -1 and how it can be used to discriminate between
two linearly separable classes.
Perceptron
46
https://towardsdatascience.com/sigmoid-neuron-deep-neural-networks-a4cd35b629d7
Why Sigmoid Neuron
49
⮚ The inputs to the sigmoid neuron can be real numbers unlike the
boolean inputs in MP Neuron and the output will also be a real
number between 0–1.
⮚ In the sigmoid neuron, we are trying to regress the relationship
between X and Y in terms of probability.
⮚ Even though the output is between 0–1, we can still use the
sigmoid function for binary classification tasks by choosing
some threshold.
Sigmoid Neuron
54
⮚ Learning Algorithm
⮚ algorithm for learning the parameters w and b of the sigmoid
neuron model by using the gradient descent algorithm.
1. https://towardsdatascience.com/activation-functions-neural-networks-1cbd9f8d91d6
2. https://medium.com/@abhigoku10/activation-functions-and-its-types-in-artifical-ne
ural-network-14511f3080a8
3. https://medium.com/@zeeshanmulla/cost-activation-loss-function-neural-network-d
eep-learning-what-are-these-91167825a4de
4. https://towardsdatascience.com/deep-learning-which-loss-and-activation-functions-
should-i-use-ac02f1c56aa8
Final Year
BTECH Subject : Deep Learning (PE4)
A Simple Neural Network
58
A Neuron [2]:
• (x1,x2, …xn) - input signal vector
• (w1,w2,…wn) - weights
• accumulation ( i.e. summation + addition of bias b)
• an activation function f is applied to this sum
https://medium.com/@abhigoku10/activation-functions-and-its-types-in-artifical-neural-network-14511f30
80a8
Activation Function
59
⮚ The function
⮚ attached to each neuron in the network
⮚ determines whether neuron should be activated (“fired”)
or not,
⮚ based on whether each neuron’s input is relevant for the
model’s prediction
⮚ Computationally efficient (calculated across
thousands/millions of neurons for each data sample)
⮚ The need for speed has led to the development of
new functions such as ReLu
Activation Function (Types)
61
https://medium.com/@abhigoku10/activation-functions-and-its-types-in-artifical-neural-network-1451
1f3080a8
Activation Function (Linear)
62
⮚ ReLU Advantages
⮚ Computationally efficient—allows the network to
converge very quickly
⮚ Non-linear—although it looks like a linear function, ReLU
has a derivative function and allows for backpropagation
⮚ Disadvantages
⮚ The Dying ReLU problem—when inputs approach zero,
or are negative, the gradient of the function becomes zero,
the network cannot perform backpropagation and cannot
learn
Activation Function (Non-Linear)
68
⮚ Leaky ReLU
⮚ Attempt to solve the dying ReLU problem (a small positive
slope in the negative area enables backpropagation)
⮚ The leak helps to increase the range of the ReLU function
⮚ f(x) = ax for x<0 and f(x) = x for x>0
⮚ Range : (0.01 to infinity)
⮚ When a is not 0.01 then it is called Randomized ReLU.
Activation Function (Non-Linear)
69
Src: Sze, Vivienne & Chen, Yu-Hsin & Yang, Tien-Ju & Emer, Joel. (2017). Efficient Processing of Deep Neural Networks: A Tutorial and Survey.
Proceedings of the IEEE. 105.
Activation Function
70
⮚ Various activation functions that can be used with Perceptron are shown
here.
https://www.simplilearn.com/what-is-perceptron-tutorial
Loss Function
72
loss function
=
cost function
=
objective function
=
error function
Loss function
input output
https://towardsdatascience.com/deep-learning-which-loss-and-activation-functions-should-i-use-ac02f1
c56aa8
Loss Function
80
• https://towardsdatascience.com/activation-functions-neural-ne
tworks-1cbd9f8d91d6
• https://medium.com/@abhigoku10/activation-functions-and-it
s-types-in-artifical-neural-network-14511f3080a8
• https://medium.com/@zeeshanmulla/cost-activation-loss-func
tion-neural-network-deep-learning-what-are-these-91167825a
4de
• https://towardsdatascience.com/deep-learning-which-loss-and
-activation-functions-should-i-use-ac02f1c56aa8
References
84
• https://www.simplilearn.com/what-is-perceptron-tutorial
• https://towardsdatascience.com/sigmoid-neuron-deep-neural-
networks-a4cd35b629d7
• https://www.javatpoint.com/artificial-neural-network