Cours setting up your Machine learning une resume pour machine learning
Size: 3.64 MB
Language: en
Added: Oct 10, 2025
Slides: 39 pages
Slide Content
Setting up your
ML application
Train/dev/test
sets
deeplearning.ai
Andrew Ng
Applied ML is a highly iterative process
Idea
Experiment Code
# layers
# hidden units
learning rates
activation functions
…
Andrew Ng
Train/dev/test sets
Andrew Ng
Mismatched train/test distribution
Training set:
Cat pictures from
webpages
Dev/test sets:
Cat pictures from
users using your app
Not having a test set might be okay. (Only dev set.)
Setting up your
ML application
Bias/Variance
deeplearning.ai
Andrew Ng
Bias and Variance
high bias “just right”high variance
Andrew Ng
Bias and Variance
Cat classification
Train set error:
Dev set error:
Andrew Ng
High bias and high variance
!"
!#
Setting up your
ML application
Basic “recipe”
for machine learningdeeplearning.ai
Andrew Ng
Basic recipe for machine learning
Regularizing your
neural network
Regularization
deeplearning.ai
Andrew Ng
Logistic regression
min
$,&
'(),*)
Andrew Ng
Neural network
Regularizing your
neural network
Why regularization
reduces overfitting
deeplearning.ai
Andrew Ng
How does regularization prevent overfitting?
!"
!#
!$
%&
high bias “just right”high variance
Andrew Ng
How does regularization prevent overfitting?
Regularizing your
neural network
Dropout
regularization
deeplearning.ai
Andrew Ng
Dropout regularization
!"
!#
$%
!&
!'
!"
!#
$%
!&
!'
Andrew Ng
Implementing dropout (“Inverted dropout”)
Andrew Ng
Making predictions at test time
Regularizing your
neural network
Understanding
dropout
deeplearning.ai
Andrew Ng
Why does drop-out work?
Intuition: Can’t rely on any one feature, so have to
spread out weights.
!"
!# $%
!&
Regularizing your
neural network
Other regularization
methods
deeplearning.ai
Andrew Ng
Data augmentation
4
Andrew Ng
Early stopping
# iterations
Setting up your
optimization problem
Normalizing inputs
deeplearning.ai
Andrew Ng
Normalizing training sets
!"
!#
5
3
!#
!"
!#
!"
Vanishing/exploding
gradients
deeplearning.ai
Setting up your
optimization problem
Andrew Ng
Vanishing/exploding gradients
!"
!#
=
$%
Andrew Ng
Single neuron example
!"
!#
!$
!%
&'
(=*(,)
Numerical approximation
of gradients
deeplearning.ai
Setting up your
optimization problem
Andrew Ng
Checking your derivative computation
!
Andrew Ng
Checking your derivative computation
!
Gradient Checking
deeplearning.ai
Setting up your
optimization problem
Andrew Ng
Gradient check for a neural network
Take !
",$
["],…,!
(,$
(and reshape into a big vector ).
Take +!
",+$
["],…,+!
(,+$
(and reshape into a big vector d).
Andrew Ng
Gradient checking (Grad check)
Gradient Checking
implementation notesdeeplearning.ai
Setting up your
optimization problem
Andrew Ng
Gradient checking implementation notes
-Don’t use in training –only to debug
-If algorithm fails grad check, look at components to try to identify bug.
-Remember regularization.
-Doesn’t work with dropout.
-Run at random initialization; perhaps again after some training.