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

Similar to #7 Neural Networks Artificial intelligence (20)

PPTX
IAI - UNIT 3 - ANN, EMERGENT SYSTEMS.pptx
xilep87615
 
PDF
Deep Learning Survey
Anthony Parziale
 
PDF
A Study On Deep Learning
Abdelrahman Hosny
 
PDF
Introduction to Neural Networks
Databricks
 
PDF
Machine learningiwijshdbebhehehshshsj.pdf
arewho557
 
PDF
M7 - Neural Networks in machine learning.pdf
ArushiKansal3
 
PPTX
Deep learning
Pratap Dangeti
 
PPTX
Deep learning crash course
Vishwas N
 
PPTX
Visualization of Deep Learning
YaminiAlapati1
 
PPTX
Basics_Of_Neural_Networks and its features.pptx
Sowmya Ms
 
PPTX
1.Introduction to Artificial Neural Networks.pptx
salahidddin
 
PPTX
1.Introduction to Artificial Neural Networks.pptx
salahidddin
 
PDF
Neural Networks and Deep Learning
Asim Jalis
 
PDF
Deep learning - a primer
Uwe Friedrichsen
 
PDF
Deep learning - a primer
Shirin Elsinghorst
 
PPTX
100-Concepts-of-AI by Anupama Kate .pptx
Anupama Kate
 
PDF
Deep Learning: concepts and use cases (October 2018)
Julien SIMON
 
PPTX
Deep Learning Tutorial | Deep Learning Tutorial For Beginners | What Is Deep ...
Simplilearn
 
PDF
Machine(s) Learning with Neural Networks
Bruno Gonçalves
 
PPTX
A Beginner's Approach to Deep Learning Techniques
DrAnirbanDasgupta1
 
IAI - UNIT 3 - ANN, EMERGENT SYSTEMS.pptx
xilep87615
 
Deep Learning Survey
Anthony Parziale
 
A Study On Deep Learning
Abdelrahman Hosny
 
Introduction to Neural Networks
Databricks
 
Machine learningiwijshdbebhehehshshsj.pdf
arewho557
 
M7 - Neural Networks in machine learning.pdf
ArushiKansal3
 
Deep learning
Pratap Dangeti
 
Deep learning crash course
Vishwas N
 
Visualization of Deep Learning
YaminiAlapati1
 
Basics_Of_Neural_Networks and its features.pptx
Sowmya Ms
 
1.Introduction to Artificial Neural Networks.pptx
salahidddin
 
1.Introduction to Artificial Neural Networks.pptx
salahidddin
 
Neural Networks and Deep Learning
Asim Jalis
 
Deep learning - a primer
Uwe Friedrichsen
 
Deep learning - a primer
Shirin Elsinghorst
 
100-Concepts-of-AI by Anupama Kate .pptx
Anupama Kate
 
Deep Learning: concepts and use cases (October 2018)
Julien SIMON
 
Deep Learning Tutorial | Deep Learning Tutorial For Beginners | What Is Deep ...
Simplilearn
 
Machine(s) Learning with Neural Networks
Bruno Gonçalves
 
A Beginner's Approach to Deep Learning Techniques
DrAnirbanDasgupta1
 

Recently uploaded (20)

PDF
BÀI TẬP BỔ TRỢ THEO LESSON TIẾNG ANH - I-LEARN SMART WORLD 7 - CẢ NĂM - CÓ ĐÁ...
Nguyen Thanh Tu Collection
 
PPTX
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
PPTX
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
PPTX
Explorando Recursos do Summer '25: Dicas Essenciais - 02
Mauricio Alexandre Silva
 
PDF
Federal dollars withheld by district, charter, grant recipient
Mebane Rash
 
PPTX
nutriquiz grade 4.pptx...............................................
ferdinandsanbuenaven
 
PDF
Comprehensive Guide to Writing Effective Literature Reviews for Academic Publ...
AJAYI SAMUEL
 
PPTX
PPT on the Development of Education in the Victorian England
Beena E S
 
PPTX
How to Configure Access Rights of Manufacturing Orders in Odoo 18 Manufacturing
Celine George
 
PPTX
Modern analytical techniques used to characterize organic compounds. Birbhum ...
AyanHossain
 
PPTX
Gall bladder, Small intestine and Large intestine.pptx
rekhapositivity
 
PDF
IMP NAAC REFORMS 2024 - 10 Attributes.pdf
BHARTIWADEKAR
 
PPTX
How to Configure Storno Accounting in Odoo 18 Accounting
Celine George
 
PPTX
classroom based quiz bee.pptx...................
ferdinandsanbuenaven
 
PPSX
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
PPTX
ROLE OF ANTIOXIDANT IN EYE HEALTH MANAGEMENT.pptx
Subham Panja
 
PPT
digestive system for Pharm d I year HAP
rekhapositivity
 
PPTX
Mrs Mhondiwa Introduction to Algebra class
sabinaschimanga
 
PPTX
ANORECTAL MALFORMATIONS: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
PDF
Ziehl-Neelsen Stain: Principle, Procedu.
PRASHANT YADAV
 
BÀI TẬP BỔ TRỢ THEO LESSON TIẾNG ANH - I-LEARN SMART WORLD 7 - CẢ NĂM - CÓ ĐÁ...
Nguyen Thanh Tu Collection
 
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
Explorando Recursos do Summer '25: Dicas Essenciais - 02
Mauricio Alexandre Silva
 
Federal dollars withheld by district, charter, grant recipient
Mebane Rash
 
nutriquiz grade 4.pptx...............................................
ferdinandsanbuenaven
 
Comprehensive Guide to Writing Effective Literature Reviews for Academic Publ...
AJAYI SAMUEL
 
PPT on the Development of Education in the Victorian England
Beena E S
 
How to Configure Access Rights of Manufacturing Orders in Odoo 18 Manufacturing
Celine George
 
Modern analytical techniques used to characterize organic compounds. Birbhum ...
AyanHossain
 
Gall bladder, Small intestine and Large intestine.pptx
rekhapositivity
 
IMP NAAC REFORMS 2024 - 10 Attributes.pdf
BHARTIWADEKAR
 
How to Configure Storno Accounting in Odoo 18 Accounting
Celine George
 
classroom based quiz bee.pptx...................
ferdinandsanbuenaven
 
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
ROLE OF ANTIOXIDANT IN EYE HEALTH MANAGEMENT.pptx
Subham Panja
 
digestive system for Pharm d I year HAP
rekhapositivity
 
Mrs Mhondiwa Introduction to Algebra class
sabinaschimanga
 
ANORECTAL MALFORMATIONS: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
Ziehl-Neelsen Stain: Principle, Procedu.
PRASHANT YADAV
 
Ad

#7 Neural Networks Artificial intelligence