SlideShare a Scribd company logo
Day 2  build up your own neural network
Day 2  build up your own neural network
Day 2  build up your own neural network
Day 2  build up your own neural network
Day 2  build up your own neural network
ICEBREAKER
Huỳnh Ngọc Như
@nhu.huynh1142002
Let’s get to know each other!
Rules:
- The game includes 1 small example and 7 questions
- Based on the hints given, including pictures, scrambled letters, you will
have 20 seconds to come up with the correct word
- The person with the earliest correct answers will get 1 point.
y/b/ứ/t/ả/h
Example:
T h ứ b ả y
_ _ _ _ _ _
Get ready?
ầ/k/n/h/i/h/t/n
Question 1:
T h ầ n k i n h
_ _ _ _ _ _ _ _
á/c/y/ọ/m/h
Question 2:
H ọ c m á y
_ _ _ _ _ _
n/z/o/p/o/i/t/i/a/m/t/i
Question 3:
O p t i m i z a t i o n
_ _ _ _ _ _ _ _ _ _ _ _
n/h/ế/t/n/y/n/u/t/í
Question 4:
T u y ế n t í n h
_ _ _ _ _ _ _ _ _
Question 5:
A r t i f i c i a l I n t e l l i g e n c e
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
g/i/o/s/l/i/t/c
Question 6:
L o g i s t i c
_ _ _ _ _ _ _ _
u/n/t/s/f/n/o/i/c
Question 7:
F u n c t i o n s
_ _ _ _ _ _ _ _ _
Summary
1. Thần kinh (Neuron/Neural Network)
2. Học máy (Machine Learning)
3. Optimization (Tối ưu hoá)
4. Tuyến tính (Linear)
5. Artificial Intelligence (Trí tuệ nhân tạo)
6. Logistic
7. Functions (Hàm số)
how-to-AI Series: Unlock Potential
Day 2: Build UP your own Neural
Network
Phạm Khánh Trình
@trinh.phamkhanh
Nguyễn Thế Bình
@binh.nguyen288
Outline
1. Break the ice
2. Linear Regression & Logistic Regression
3. Neural Network
4. Demo Time
Common AI & ML
Problems
How to model the relations between the variables?
Fig 1: Regression Fig 2: Classification
Linear Regression
Logistic Regression
Univariate Linear
Regression
Basic idea of Univariate LR:
Given some data points (x, y).
We find the red line y = wx + b that best describe / fit the data!
Index x y
0 1 2
1 2 4
2 3 6
3 4 8
4 5 10
5 6 12
6 7 14
7 8 16
8 9 18
We define a function with respect to w and b, called the loss function L, for
instance
The best fit line is the line with minimum value loss function!
What does it mean by “best fit”?
It’s just an optimization problem
That makes sense, but how do we
find the optimal value of w and b?
Two optimization approach
- Using Calculus 2 to find the closed-form formula
(not always possible)
- Iterative algorithm: Gradient Descent
Step 1: Compute the gradient
Step 2: Find stationary points by letting the gradient
zero:
Formula derivation using Calculus 2
Using gradient descent
Loop 7749 times:
Wait, how does that even work?
Sound familiar, right?
Fig 1: One variable Fig 2: Two variables
The influence of learning rate
It’s a way to control the magnitude of gradients
Fig 1: Too small gradient Fig 2: Too large gradient
Multivariate Linear
Regression
Limitation of naive linear regression
We have more than 1 variables
Modeling polynomial relation
Linear regression can be not “linear”
- Step 1: Collect the relevant data (the data points)
- Step 2: Choose a suitable model (linear regression for example)
- Step 3: Choose a loss function with respect to the data (such as SSE)
- Step 4: Minimize the loss function with respect to the parameters using an
optimization algorithm (Gradient Descent)
Let’s backtrack
There are 4 steps to build a machine learning model
Linear regression
Logistic regression
Logistic
Regression
Linear regression in classification?
Just don’t :)
Sometime we want the output of the function to be:
- Strictly increasing and analytical
- Bounded in (0, 1) to be probabilistic
The sigmoid function is a perfect fit for both of these
Sigmoid function, an activation function
Yet another function to learn, huh?
In logistic regression, we apply sigmoid function on top of linear regression in
order to squeeze output range into (0, 1)
Logistic regression idea
Basically, that’s sigmoid(linear regression)
The choice of loss function
Gradient descent could only reach local minima
for non-convex functions
Since the label of logistic problem can be only be binary, we can be a little bit
smarter
What is wrong with sum of squares?
Formula of binary cross entropy
In short, by using this loss function, the loss function is now convex.
Binary cross entropy
Note: Multiclass variant of this is cross entropy
Linear Regression
Logistic Regression
Optimization?
Sadly, there is no closed-form formula for Logistic Regression, here
is the gradient for univariate case, good luck solving those :)
Thus the only choice here is Gradient Descent.
Kahoot time!
Logistic regression can be used to infer whether a feature is active of not
according to the given features, by stacking up multiple logistic regressions, we
get the fundamental idea of neural network
Insight of Logistic Regression
Motivation to neural network
Neural Network
What is a Neural Network?
A human brain or something?
Artificial Neural Network (ANN)
Neural Network
Source: https://www.packtpub.com/product/deep-learning-essentials/9781785880360
Rosenblatt’s work: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.335.3398&rep=rep1&type=pdf
History
“Later Perceptrons will be able to recognize people
and call out their names and instantly translate
speech in one language to speech or writing in
another language, it was predicted.”
NY Times ━ "New Navy Device Learns By Doing" 7/7/1958
Reminder: Logistic Regression
Source: https://pythonmachinelearning.pro/perceptrons-the-first-neural-networks/
Reminder: Logistic Regression
Source: https://www.coursera.org/learn/machine-learning
XOR Problem
XOR Solution
XOR Solution
XOR Solution
Another Case
Source:
https://towardsdatascience.com/beginners-ask-how-many-hidden-layers-neurons-to-use-in-artificial-neural-networks-51466afa0d3e
Reminder: Logistic Regression
Source: https://www.coursera.org/learn/machine-learning
Neural Network
Backpropagation
Activation
Softmax Function
“Data scientists call the layer-by-layer process of
matrix multiplication followed by non-linear
activation functions, transforming the feature
space.”
Alando Ballantyne ━ Minsky's "And / Or" Theorem: A Single Perceptron Limitations.
Step 1: Determine the network structure (the number of layers, which activation
functions to choose).
Step 2: Load the data as input to the Neural Network
Repeat {
Step 3: Forward the data through the network, calculate the Loss function.
Step 4: Backpropagation to find the weight gradients → update the weights.
} Until convergence.
Let’s recap!
Neural Network in a nutshell
How does Neural Network works?
Flatten
Neural Network
Basically, it is a complex function (a combination of many
functions) to solve a complex task.
“The result of a Neural Network can approximate any
well-behaved function 𝟋 by using the same
construction for the first layer and approximating the
identity function with later layers.”
Universal Approximation Theorem
State-of-the-art Neural Network
Convolutional Neural Network
Recurrent Neural Network
Let’s play some codes!
https://colab.research.google.com/drive/1bOQdxTtE2Ge73
gbKuH2Dpk8mXBFwJmXw?usp=sharing
Q&A
Feedback form
https://tinyurl.com/a78ahspe
Thank You!

More Related Content

PDF
Day 4
PPTX
Tips and tricks to win kaggle data science competitions
PDF
House Price Estimation as a Function Fitting Problem with using ANN Approach
PPTX
How to Win Machine Learning Competitions ?
PPTX
Deep learning Introduction and Basics
PPTX
Make Sense Out of Data with Feature Engineering
PPTX
Deep learning crash course
PPTX
Genetic algorithm for hyperparameter tuning
Day 4
Tips and tricks to win kaggle data science competitions
House Price Estimation as a Function Fitting Problem with using ANN Approach
How to Win Machine Learning Competitions ?
Deep learning Introduction and Basics
Make Sense Out of Data with Feature Engineering
Deep learning crash course
Genetic algorithm for hyperparameter tuning

What's hot (20)

PPTX
Basic image analysis(processing and classification) and visualization using m...
PPTX
Hyperparameter Tuning
PDF
Kaggle presentation
PDF
AWS Certified Machine Learning Specialty
PDF
H2O World - Top 10 Deep Learning Tips & Tricks - Arno Candel
PPTX
Understanding Basics of Machine Learning
PPTX
Machine learning basics
PPTX
Machine Learning Basics
PPTX
Introduction to Machine Learning
PPTX
Overfitting & Underfitting
PPTX
Machine Learning basics
PPTX
2018 Global Azure Bootcamp Azure Machine Learning for neural networks
PDF
Reinforcement learning Research experiments OpenAI
PPTX
Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...
PPTX
BI_Final_Group_1
PPTX
Introduction to Machine Learning
PDF
Winning Kaggle 101: Introduction to Stacking
PDF
Machine learning the next revolution or just another hype
PDF
Deep Dive into Hyperparameter Tuning
PPTX
Algorithm
Basic image analysis(processing and classification) and visualization using m...
Hyperparameter Tuning
Kaggle presentation
AWS Certified Machine Learning Specialty
H2O World - Top 10 Deep Learning Tips & Tricks - Arno Candel
Understanding Basics of Machine Learning
Machine learning basics
Machine Learning Basics
Introduction to Machine Learning
Overfitting & Underfitting
Machine Learning basics
2018 Global Azure Bootcamp Azure Machine Learning for neural networks
Reinforcement learning Research experiments OpenAI
Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...
BI_Final_Group_1
Introduction to Machine Learning
Winning Kaggle 101: Introduction to Stacking
Machine learning the next revolution or just another hype
Deep Dive into Hyperparameter Tuning
Algorithm
Ad

Similar to Day 2 build up your own neural network (20)

PPT
Machine Learning ICS 273A
DOCX
Bca2020 data structure and algorithm
PPTX
aaaaaaaaaaaaaaaaaaadeep learning basics.pptx
PDF
Non Anthropomorhic Deep Learning Developing the Eyes for the Internet of Things
PDF
nlp dl 1.pdf
PPTX
Deep learning (2)
PPTX
Machine learning introduction
PPTX
Deep learning from scratch
PPTX
What Deep Learning Means for Artificial Intelligence
PDF
ProjectReport
PDF
Understanding Deep Learning & Parameter Tuning with MXnet, H2o Package in R
PDF
Camp IT: Making the World More Efficient Using AI & Machine Learning
PDF
Easy to learn deep learning guide - elementry
PPTX
Predict saturated thickness using tensor board visualization
PDF
Neural Nets Deconstructed
PPT
Machine Learning: Foundations Course Number 0368403401
PDF
21AI401 AI Unit 1.pdf
PPT
Machine Learning
PDF
Recursive algorithms in depth - Geek gap webinar #2
PPTX
Neural Learning to Rank
Machine Learning ICS 273A
Bca2020 data structure and algorithm
aaaaaaaaaaaaaaaaaaadeep learning basics.pptx
Non Anthropomorhic Deep Learning Developing the Eyes for the Internet of Things
nlp dl 1.pdf
Deep learning (2)
Machine learning introduction
Deep learning from scratch
What Deep Learning Means for Artificial Intelligence
ProjectReport
Understanding Deep Learning & Parameter Tuning with MXnet, H2o Package in R
Camp IT: Making the World More Efficient Using AI & Machine Learning
Easy to learn deep learning guide - elementry
Predict saturated thickness using tensor board visualization
Neural Nets Deconstructed
Machine Learning: Foundations Course Number 0368403401
21AI401 AI Unit 1.pdf
Machine Learning
Recursive algorithms in depth - Geek gap webinar #2
Neural Learning to Rank
Ad

More from HuyPhmNht2 (6)

PPTX
Slide.pptx
PDF
Introduction to figma
PDF
Info seminar 2021
PDF
Day 5
PDF
Day 3 take up convolutional neural network
PDF
Day 1 wazz up ai
Slide.pptx
Introduction to figma
Info seminar 2021
Day 5
Day 3 take up convolutional neural network
Day 1 wazz up ai

Recently uploaded (20)

PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
Well-logging-methods_new................
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
Welding lecture in detail for understanding
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
Construction Project Organization Group 2.pptx
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
Sustainable Sites - Green Building Construction
PPTX
OOP with Java - Java Introduction (Basics)
PPT
Project quality management in manufacturing
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
Digital Logic Computer Design lecture notes
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Well-logging-methods_new................
UNIT 4 Total Quality Management .pptx
CH1 Production IntroductoryConcepts.pptx
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Welding lecture in detail for understanding
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Construction Project Organization Group 2.pptx
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Sustainable Sites - Green Building Construction
OOP with Java - Java Introduction (Basics)
Project quality management in manufacturing
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Digital Logic Computer Design lecture notes
bas. eng. economics group 4 presentation 1.pptx
Foundation to blockchain - A guide to Blockchain Tech

Day 2 build up your own neural network