SlideShare a Scribd company logo
1 of 8
Download to read offline
Deep Learning - Artificial Neural Networks Muhammad Aleem Siddiqui
What is an Artificial Neural Network ?
An artificial neural network is a mathematical function
which maps given input to a desired output.
It consists of following,
1. An input layer, x
2. An arbitrary amount of hidden layers
3. An output layer, ŷ
4. A set of weights and biases between each layer, W and b
5. A choice of activation function for each hidden layer, σ
Sigmoid activation function or ReLU - Rectified Linear Unit
What is an Activation Function ?
In artificial neural networks, the activation
function of a node defines the output of that
node given an input or set of inputs.
A standard computer chip circuit can be seen
as a digital network of activation functions that
can be "ON" or "OFF", depending on input.
Training The Neural Network
The output ŷ of a simple 2-layer Neural Network is 
The right values for the weights and biases determines
the strength of the predictions. The process of fine-tuning
the weights and biases from the input data is known as
training the Neural Network
Each iteration of the training process consists of the
following steps:
1. Calculating the predicted output ŷ, known as
feedforward
2. Updating the weights and biases, known as
backpropagation
Feed Forward
In feedforward networks information only travels
forward in the network, first through the input nodes, then
through the hidden nodes, and finally through the output
nodes.
Calculating the predicted output ŷ is known as
feedforward.
2 Layered Feedforward Artificial Neural Network
Loss Function
There are many available loss functions, and the
nature of problem should determine the choice of loss
function to be used.
Most commonly used is, Sum-of-Squares Error
It is the sum of the difference between each predicted
value and the actual value. The difference is squared
so that we measure the absolute value of the
difference.
Our goal in training is to find the best set of weights
and biases that minimizes the loss function.
Back Propagation
Back-propagation is a technique of neural
network training. It is the method of fine-tuning
the weights of a neural network based on the
error rate.
This method helps to calculate the gradient of a
loss function with respects to all the weights in the
network.
After computing the derivative, the weights and
biases can simply updated by increasing/
reducing them. This is known as gradient descent.
2 Layered Neural Network for Predicting Exclusive-OR
import numpy as np
epochs = 60000 # Number of iterations
inputLayerSize, hiddenLayerSize, outputLayerSize = 2, 3, 1
X = np.array([[0,0], [0,1], [1,0], [1,1]])
Y = np.array([ [0], [1], [1], [0]])
def sigmoid (x): return 1/(1 + np.exp(-x)) # activation function
def sigmoidPrime(x): return x * (1 - x) # derivative of sigmoid
np.random.seed(1) #Seeding / Initializing Random Values in same sequence every time.
Wh = np.random.uniform(size=(inputLayerSize, hiddenLayerSize))+1 # weights on layer inputs + bais
Wy = np.random.uniform(size=(hiddenLayerSize, outputLayerSize))+1 # weights on layer inputs + bais
for i in range(epochs):
H = sigmoid(np.dot(X, Wh)) # hidden layer results
Y_Hat = sigmoid(np.dot(H, Wy)) # output layer results
E = Y - Y_Hat # how much we missed (error)
dY = E * sigmoidPrime(Y_Hat) # delta Y
dH = dY.dot(Wy.T) * sigmoidPrime(H) # delta H
Wy += H.T.dot(dY) # update output layer weights
Wh += X.T.dot(dH) # update hidden layer weights
print(Y_Hat)

More Related Content

What's hot

NEURAL Network Design Training
NEURAL Network Design  TrainingNEURAL Network Design  Training
NEURAL Network Design Training
ESCOM
 
Forecasting of Sales using Neural network techniques
Forecasting of Sales using Neural network techniquesForecasting of Sales using Neural network techniques
Forecasting of Sales using Neural network techniques
Hitesh Dua
 

What's hot (20)

Neural network
Neural networkNeural network
Neural network
 
Introduction Of Artificial neural network
Introduction Of Artificial neural networkIntroduction Of Artificial neural network
Introduction Of Artificial neural network
 
ANN load forecasting
ANN load forecastingANN load forecasting
ANN load forecasting
 
Neural Network Research Projects Topics
Neural Network Research Projects TopicsNeural Network Research Projects Topics
Neural Network Research Projects Topics
 
Artificial neural network
Artificial neural networkArtificial neural network
Artificial neural network
 
Artificial Neural Network
Artificial Neural NetworkArtificial Neural Network
Artificial Neural Network
 
Artificial neural network
Artificial neural networkArtificial neural network
Artificial neural network
 
Artificial Neural Network
Artificial Neural NetworkArtificial Neural Network
Artificial Neural Network
 
Artificial Neural Network report
Artificial Neural Network reportArtificial Neural Network report
Artificial Neural Network report
 
Artificial neural network
Artificial neural networkArtificial neural network
Artificial neural network
 
NEURAL Network Design Training
NEURAL Network Design  TrainingNEURAL Network Design  Training
NEURAL Network Design Training
 
Neural networks
Neural networksNeural networks
Neural networks
 
Artificial Neural Network and its Applications
Artificial Neural Network and its ApplicationsArtificial Neural Network and its Applications
Artificial Neural Network and its Applications
 
Artificial Neural Network seminar presentation using ppt.
Artificial Neural Network seminar presentation using ppt.Artificial Neural Network seminar presentation using ppt.
Artificial Neural Network seminar presentation using ppt.
 
Artificial Neural Network
Artificial Neural NetworkArtificial Neural Network
Artificial Neural Network
 
Artificial neural networks seminar presentation using MSWord.
Artificial neural networks seminar presentation using MSWord.Artificial neural networks seminar presentation using MSWord.
Artificial neural networks seminar presentation using MSWord.
 
Forecasting of Sales using Neural network techniques
Forecasting of Sales using Neural network techniquesForecasting of Sales using Neural network techniques
Forecasting of Sales using Neural network techniques
 
Artificial neural network
Artificial neural networkArtificial neural network
Artificial neural network
 
Artificial neural network
Artificial neural networkArtificial neural network
Artificial neural network
 
Artificial Neural Network Paper Presentation
Artificial Neural Network Paper PresentationArtificial Neural Network Paper Presentation
Artificial Neural Network Paper Presentation
 

Similar to Neural network

Electricity Demand Forecasting Using Fuzzy-Neural Network
Electricity Demand Forecasting Using Fuzzy-Neural NetworkElectricity Demand Forecasting Using Fuzzy-Neural Network
Electricity Demand Forecasting Using Fuzzy-Neural Network
Naren Chandra Kattla
 
Electricity Demand Forecasting Using ANN
Electricity Demand Forecasting Using ANNElectricity Demand Forecasting Using ANN
Electricity Demand Forecasting Using ANN
Naren Chandra Kattla
 
NeuralProcessingofGeneralPurposeApproximatePrograms
NeuralProcessingofGeneralPurposeApproximateProgramsNeuralProcessingofGeneralPurposeApproximatePrograms
NeuralProcessingofGeneralPurposeApproximatePrograms
Mohid Nabil
 

Similar to Neural network (20)

Neural-Networks.ppt
Neural-Networks.pptNeural-Networks.ppt
Neural-Networks.ppt
 
Artificial Neural Network for machine learning
Artificial Neural Network for machine learningArtificial Neural Network for machine learning
Artificial Neural Network for machine learning
 
19_Learning.ppt
19_Learning.ppt19_Learning.ppt
19_Learning.ppt
 
Artificial neural networks
Artificial neural networks Artificial neural networks
Artificial neural networks
 
2.5 backpropagation
2.5 backpropagation2.5 backpropagation
2.5 backpropagation
 
Electricity Demand Forecasting Using Fuzzy-Neural Network
Electricity Demand Forecasting Using Fuzzy-Neural NetworkElectricity Demand Forecasting Using Fuzzy-Neural Network
Electricity Demand Forecasting Using Fuzzy-Neural Network
 
Acem neuralnetworks
Acem neuralnetworksAcem neuralnetworks
Acem neuralnetworks
 
Artificial Neural Networks ppt.pptx for final sem cse
Artificial Neural Networks  ppt.pptx for final sem cseArtificial Neural Networks  ppt.pptx for final sem cse
Artificial Neural Networks ppt.pptx for final sem cse
 
Electricity Demand Forecasting Using ANN
Electricity Demand Forecasting Using ANNElectricity Demand Forecasting Using ANN
Electricity Demand Forecasting Using ANN
 
Character Recognition using Artificial Neural Networks
Character Recognition using Artificial Neural NetworksCharacter Recognition using Artificial Neural Networks
Character Recognition using Artificial Neural Networks
 
6
66
6
 
ANN.pptx
ANN.pptxANN.pptx
ANN.pptx
 
Artificial Neural Networks-Supervised Learning Models
Artificial Neural Networks-Supervised Learning ModelsArtificial Neural Networks-Supervised Learning Models
Artificial Neural Networks-Supervised Learning Models
 
Artificial Neural Networks-Supervised Learning Models
Artificial Neural Networks-Supervised Learning ModelsArtificial Neural Networks-Supervised Learning Models
Artificial Neural Networks-Supervised Learning Models
 
Artificial Neural Networks-Supervised Learning Models
Artificial Neural Networks-Supervised Learning ModelsArtificial Neural Networks-Supervised Learning Models
Artificial Neural Networks-Supervised Learning Models
 
Neural Networks
Neural NetworksNeural Networks
Neural Networks
 
CS767_Lecture_05.pptx
CS767_Lecture_05.pptxCS767_Lecture_05.pptx
CS767_Lecture_05.pptx
 
NeuralProcessingofGeneralPurposeApproximatePrograms
NeuralProcessingofGeneralPurposeApproximateProgramsNeuralProcessingofGeneralPurposeApproximatePrograms
NeuralProcessingofGeneralPurposeApproximatePrograms
 
Towards neuralprocessingofgeneralpurposeapproximateprograms
Towards neuralprocessingofgeneralpurposeapproximateprogramsTowards neuralprocessingofgeneralpurposeapproximateprograms
Towards neuralprocessingofgeneralpurposeapproximateprograms
 
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 13
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 13Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 13
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 13
 

More from Muhammad Aleem Siddiqui

More from Muhammad Aleem Siddiqui (8)

Reinforcement Learning using OpenAI Gym
Reinforcement Learning using OpenAI GymReinforcement Learning using OpenAI Gym
Reinforcement Learning using OpenAI Gym
 
Crop Analysis using Unmanned Aerial Vehicle
Crop Analysis using Unmanned Aerial VehicleCrop Analysis using Unmanned Aerial Vehicle
Crop Analysis using Unmanned Aerial Vehicle
 
Precision Irrigation using IoT and Machine Learning for Drip Irrigation
Precision Irrigation using IoT and Machine Learning for Drip IrrigationPrecision Irrigation using IoT and Machine Learning for Drip Irrigation
Precision Irrigation using IoT and Machine Learning for Drip Irrigation
 
Multispectral Imagery Data for Agricultural Surveying
Multispectral Imagery Data for Agricultural SurveyingMultispectral Imagery Data for Agricultural Surveying
Multispectral Imagery Data for Agricultural Surveying
 
Mobile Robot for Agriculture Farming
Mobile Robot for Agriculture FarmingMobile Robot for Agriculture Farming
Mobile Robot for Agriculture Farming
 
Unmanned Aerial Vehicle - Aerial Robotics
Unmanned Aerial Vehicle - Aerial RoboticsUnmanned Aerial Vehicle - Aerial Robotics
Unmanned Aerial Vehicle - Aerial Robotics
 
Precision Agriculture
Precision AgriculturePrecision Agriculture
Precision Agriculture
 
Data structures and algorithm analysis in java
Data structures and algorithm analysis in javaData structures and algorithm analysis in java
Data structures and algorithm analysis in java
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 

Neural network

  • 1. Deep Learning - Artificial Neural Networks Muhammad Aleem Siddiqui
  • 2. What is an Artificial Neural Network ? An artificial neural network is a mathematical function which maps given input to a desired output. It consists of following, 1. An input layer, x 2. An arbitrary amount of hidden layers 3. An output layer, ŷ 4. A set of weights and biases between each layer, W and b 5. A choice of activation function for each hidden layer, σ Sigmoid activation function or ReLU - Rectified Linear Unit
  • 3. What is an Activation Function ? In artificial neural networks, the activation function of a node defines the output of that node given an input or set of inputs. A standard computer chip circuit can be seen as a digital network of activation functions that can be "ON" or "OFF", depending on input.
  • 4. Training The Neural Network The output ŷ of a simple 2-layer Neural Network is  The right values for the weights and biases determines the strength of the predictions. The process of fine-tuning the weights and biases from the input data is known as training the Neural Network Each iteration of the training process consists of the following steps: 1. Calculating the predicted output ŷ, known as feedforward 2. Updating the weights and biases, known as backpropagation
  • 5. Feed Forward In feedforward networks information only travels forward in the network, first through the input nodes, then through the hidden nodes, and finally through the output nodes. Calculating the predicted output ŷ is known as feedforward. 2 Layered Feedforward Artificial Neural Network
  • 6. Loss Function There are many available loss functions, and the nature of problem should determine the choice of loss function to be used. Most commonly used is, Sum-of-Squares Error It is the sum of the difference between each predicted value and the actual value. The difference is squared so that we measure the absolute value of the difference. Our goal in training is to find the best set of weights and biases that minimizes the loss function.
  • 7. Back Propagation Back-propagation is a technique of neural network training. It is the method of fine-tuning the weights of a neural network based on the error rate. This method helps to calculate the gradient of a loss function with respects to all the weights in the network. After computing the derivative, the weights and biases can simply updated by increasing/ reducing them. This is known as gradient descent.
  • 8. 2 Layered Neural Network for Predicting Exclusive-OR import numpy as np epochs = 60000 # Number of iterations inputLayerSize, hiddenLayerSize, outputLayerSize = 2, 3, 1 X = np.array([[0,0], [0,1], [1,0], [1,1]]) Y = np.array([ [0], [1], [1], [0]]) def sigmoid (x): return 1/(1 + np.exp(-x)) # activation function def sigmoidPrime(x): return x * (1 - x) # derivative of sigmoid np.random.seed(1) #Seeding / Initializing Random Values in same sequence every time. Wh = np.random.uniform(size=(inputLayerSize, hiddenLayerSize))+1 # weights on layer inputs + bais Wy = np.random.uniform(size=(hiddenLayerSize, outputLayerSize))+1 # weights on layer inputs + bais for i in range(epochs): H = sigmoid(np.dot(X, Wh)) # hidden layer results Y_Hat = sigmoid(np.dot(H, Wy)) # output layer results E = Y - Y_Hat # how much we missed (error) dY = E * sigmoidPrime(Y_Hat) # delta Y dH = dY.dot(Wy.T) * sigmoidPrime(H) # delta H Wy += H.T.dot(dY) # update output layer weights Wh += X.T.dot(dH) # update hidden layer weights print(Y_Hat)