SlideShare a Scribd company logo
We are starting at 14:00!
Grab a seat and get ready
#7 Neural Networks
AI Saturdays Kigali
Agenda
14:00 - 14:20: Neural Networks
14:20 - 15:00: Deep Learning
15:00 - 15:20: Activation Function
15:20 - 15:35: Gradient Descent
15:35 - 15:45: Backpropagation
15:45 - 16:00: Regularization
16:00 - 16:30: Lunch
16:30 - 17:30: Practice
17:30 - 18:00: Challenges & Next steps
State of the course
#1 Numpy and Pandas ✅
#2 Exploratory Data Analysis (EDA) & Bias ✅
#3 Supervised Learning: Regression ✅
#4 Supervised Learning: Classification ✅
#5 Decision Trees & Random Forest ✅
#6 Unsupervised Learning ✅
#7 Neural Networks 🔴 Today!
…
Neural Networks
Neural Networks (overview)
Many tasks that involve intelligence, pattern recognition, and object detection are extremely difficult to
automate, yet seem to be performed easily and naturally by animals and young children.
Have you ever wondered how your brain recognizes images?
● No matter what or how the image looks, the brain can tell that this is an image of a cat and not a
dog.
● The brain relates to the best possible pattern and concludes the result.
Why Neural Networks?
Neural Networks: Why?
If you recall, the following classification problem is nonlinear:
"Nonlinear" means that you can't accurately predict a label with a model of the form In other words,
the "decision surface" is not a line.
Now consider the following data set:
The data set shown in the figure can't be solved with a linear model.
Neural Networks: Why?
How Neural Networks work
Neural Networks
A neuron firing is a binary operation — the neuron either fires or it doesn’t fire.
● Each neuron receives electrochemical inputs from other neurons at their dendrites.
● If these electrical inputs are sufficiently powerful to activate the neuron, then the activated
neuron transmits the signal along its axon, passing it along to the dendrites of other neurons.
● These attached neurons may also fire, thus continuing the process of passing the message along.
Simply put, a neuron will only fire
if the total signal received at the
soma exceeds a given threshold.
Neural Networks
Neural Networks are complex systems with artificial neurons.
Artificial neurons or perceptron consist of:
● Input
● Weight
● Bias
● Activation Function
● Output
Neural Networks: Topics
● Deep Learning
● Activation functions
● Gradient Descent
● Backpropagation
● Regularization
● PyTorch & Other Tools!
Deep Learning
Deep Learning
Machine Learning -> Deep Learning
What you learn in Machine Learning
DOES matter for Deep Learning!
Deep Learning: The process
Deep Learning: Neural Network (NN)
Why is a Neural Network useful?
Deep Learning: Some Applications
● Classification: do you have cancer or not?
● Speech recognition
● Natural Language Processing (NLP)
● Text recognition
● Text generation
● Image Recognition: Is It a Kitten or a Tiger?
● Particular example: Optical Character Recognition (OCR)
● Automatic translation
● Time series analysis
● Musical composition
● Video prediction
…
What are the different components of a NN?
Deep Learning: Perceptrons // Neuron
A single layer neural network
Number within each neuron: Activation
Deep Learning: Perceptrons // Neuron
Deep Learning
Neuron (activation
function)
Weight + Bias
(y = ax + b)
Multilayer perceptron
How does it work?
Deep Learning: Forward and Backward Propagation
Deep Learning: Forward Propagation (I)
Source: 3Blue1Brown
Deep Learning: Forward Propagation (II)
Source: 3Blue1Brown
Deep Learning: Forward Propagation (III)
Analogy:
(y = ax + b)
Source: 3Blue1Brown
Deep Learning: Forward Propagation (IV)
Source: 3Blue1Brown
Deep Learning: Forward Propagation (V)
Source: 3Blue1Brown
Deep Learning: Forward Propagation (VI)
Source: 3Blue1Brown
Optimized
calculation
(Vectorization)
Deep Learning: Forward Propagation (VII)
Neural networks: Nodes and hidden layers
Forward Propagation
https://developers.google.com/machine-learning/crash-course/neural-
networks/nodes-hidden-layers
Activation Function
Activation Function
An Activation Function decides whether a neuron should be activated or not.
This means that it will decide whether the neuron’s input to the network is important or not in the
process of prediction using simpler mathematical operations.
The purpose of an activation function is to add non-linearity to the neural network.
Common Activation Function
Three mathematical functions that are commonly used as activation functions are
● Sigmoid: function transforms input to produce an output value between 0 and 1
● Tanh: (short for "hyperbolic tangent") function transforms input to produce an output value
between –1 and 1
● ReLU: (short for "rectified linear unit") produces max(0, x)
Neural networks: Activation functions
Forward Propagation
https://developers.google.com/machine-learning/crash-course/neural-
networks/activation-functions
How do we know if the NN will be good or bad?
Gradient Descent
Optimizer: Gradient Descent (I)
Source: 3Blue1Brown
Gradient Descent (II)
NOTE: You were already using this to optimize various models (Reg. Linear, Reg.
Logistics, SVM)
Gradient = “Slope” (derivate) in multiple directions Source: 3Blue1Brown
Gradient Descent (III)
Source: 3Blue1Brown
How do we know if the NN will be good or bad?
Backpropagation
BackPropagation (I)
Through the backpropagation process, weights and biases are adjusted to optimize (in this case,
minimize) the cost function (for example, cross-entropy) of the neural network.
BackPropagation (II)
ALGORITHM (“AS TO WALK AT HOME”):
1. Each neuron calculates the variation that affects it, either in a
"positive" way (that is, the prediction is what is sought in that
neuron) or "negative" (it is an "undesired" prediction, or in
which the output does not must be activated).
2. Recursively, the same calculation is done on each layer of
neurons, backtracking the effect of each neuron on the final
output and updating the weights.
3. Once the input layer is reached, the next observation is taken.
4. Return to Step 1 until your training set has been fully used for
training.
HOW? WITH OPTIMIZERS (GD, SGD, etc.)
BackPropagation (II) - Cont’d
Source: Welch Labs
BackPropagation (III)
Optimizers
Gradient Descent problem: PC dies… :-( → SGD (or Adam, SGD “improved” with moving
averages)
Learning Rates
Understand the Impact of Learning Rate on Neural Network Performance
Pipeline & Argmax
CROSS-ENTROPY: cost function used to evaluate the probabilities
obtained. It is used in classification problems.
So if this works like ML, can you overfit an NN?
INDEED !
Regularization
Regularization: Methods
1) Dropout
2) Batch Normalization
3) Data Augmentation (p. ej.
flip images)
4) Early Stopping (no
“overtraining”)
6) Regularization L2 (add
component to loss to smooth
small weight updates)
5) Regularization L1 (subtract
effect to gradient)
What are the tools you can use to create a NN?
Deep Learning Libraries
Keras vs Pytorch for Deep Learning
(aka CNTK)
Lunch
Practice - NNs
https://developers.google.com/machine-learning/cra
sh-course/neural-networks/interactive-exercises
Challenges & Next
steps!
#7 Neural Networks Artificial intelligence
Any
questions?
THANKS
kigali@saturdays.ai
coming soon
coming soon

More Related Content

PDF
Understanding Deep Learning & Parameter Tuning with MXnet, H2o Package in R
PPTX
What Is Deep Learning? | Introduction to Deep Learning | Deep Learning Tutori...
PDF
Machine learningiwijshdbebhehehshshsj.pdf
PPTX
Neural Networks and its related Concepts
PPTX
UNIT IV NEURAL NETWORKS - Multilayer perceptron
PPTX
Deep learning algorithms
PPTX
Deep Learning in Recommender Systems - RecSys Summer School 2017
PDF
Artificial Neural networks
Understanding Deep Learning & Parameter Tuning with MXnet, H2o Package in R
What Is Deep Learning? | Introduction to Deep Learning | Deep Learning Tutori...
Machine learningiwijshdbebhehehshshsj.pdf
Neural Networks and its related Concepts
UNIT IV NEURAL NETWORKS - Multilayer perceptron
Deep learning algorithms
Deep Learning in Recommender Systems - RecSys Summer School 2017
Artificial Neural networks

Similar to #7 Neural Networks Artificial intelligence (20)

PPT
Neural-Networks.ppt
PPT
Soft Computing-173101
PDF
Facebook Deep face
PPT
The Introduction to Neural Networks.ppt
PPTX
Artifical Neural Network and its applications
PPTX
Visualization of Deep Learning
PPTX
Neural Network_basic_Reza_Lecture_3.pptx
PPTX
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 13
PDF
Data Science - Part VIII - Artifical Neural Network
PDF
Neural networks introduction
PPTX
Neural networks
PPTX
Neural Networks
PDF
Cognitive Science Unit 4
PPTX
Introduction to Neural networks (under graduate course) Lecture 9 of 9
PPTX
Introduction to Neural Networks
PDF
Deep learning
PPTX
Deep Learning Interview Questions And Answers | AI & Deep Learning Interview ...
PDF
introduction to deeplearning
PPTX
Neural Networks and Deep Learning: An Intro
PPTX
Deep Learning Tutorial | Deep Learning Tutorial For Beginners | What Is Deep ...
Neural-Networks.ppt
Soft Computing-173101
Facebook Deep face
The Introduction to Neural Networks.ppt
Artifical Neural Network and its applications
Visualization of Deep Learning
Neural Network_basic_Reza_Lecture_3.pptx
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 13
Data Science - Part VIII - Artifical Neural Network
Neural networks introduction
Neural networks
Neural Networks
Cognitive Science Unit 4
Introduction to Neural networks (under graduate course) Lecture 9 of 9
Introduction to Neural Networks
Deep learning
Deep Learning Interview Questions And Answers | AI & Deep Learning Interview ...
introduction to deeplearning
Neural Networks and Deep Learning: An Intro
Deep Learning Tutorial | Deep Learning Tutorial For Beginners | What Is Deep ...
Ad

Recently uploaded (20)

PPTX
Pharma ospi slides which help in ospi learning
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Classroom Observation Tools for Teachers
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Lesson notes of climatology university.
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
TR - Agricultural Crops Production NC III.pdf
Pharma ospi slides which help in ospi learning
102 student loan defaulters named and shamed – Is someone you know on the list?
Classroom Observation Tools for Teachers
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Final Presentation General Medicine 03-08-2024.pptx
Module 4: Burden of Disease Tutorial Slides S2 2025
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Anesthesia in Laparoscopic Surgery in India
Renaissance Architecture: A Journey from Faith to Humanism
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPH.pptx obstetrics and gynecology in nursing
Microbial diseases, their pathogenesis and prophylaxis
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Complications of Minimal Access Surgery at WLH
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Lesson notes of climatology university.
Pharmacology of Heart Failure /Pharmacotherapy of CHF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
TR - Agricultural Crops Production NC III.pdf
Ad

#7 Neural Networks Artificial intelligence