Cours setting up your Machine learning 2M1.pdf

KadimAbdelkarim 0 views 39 slides Oct 10, 2025
Slide 1
Slide 1 of 39
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39

About This Presentation

Cours setting up your Machine learning une resume pour machine learning


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
!#
!"
!#
!"

Andrew Ng
Why normalize inputs?
!",$=
1
'
(
*
+,-
ℒ (01
+,0
(+))
"
$
"
$
"
$
!
Unnormalized:
"
$
!
Normalized:

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.