Professional Documents
Culture Documents
Deeplearning - Ai Deeplearning - Ai
Deeplearning - Ai Deeplearning - Ai
DeepLearning.AI makes these slides available for educational purposes. You may not use or distribute
these slides for commercial purposes. You may make copies of these slides and use or distribute them for
educational purposes as long as you cite DeepLearning.AI as the source of the slides.
Basic models
deeplearning.ai
Sequence to sequence model
% "&$ % "*$ % "+$ % ",$ % "-$
Jane visite l’Afrique en septembre
Jane is visiting Africa in September.
. "&$ . "*$ . "+$ . ",$ . "-$ . "/$
!"#$ ⋯
% "&$ % "'( $
MAX-POOL MAX-POOL
11 × 11 3 × 3 5 × 5 3 × 3 3 × 3 3 × 3
s=4 s=2 same s=2 same
55×55 ×96 27×27 ×96 27×27 ×256 13×13 ×256 13×13 ×384
MAX-POOL
= ⋮ ⋮ ⋮
3 × 3 3 × 3
s=2 Softmax
1000
13×13 ×384 13×13 ×256 6×6 ×256 9216 4096 4096
%
[Mao et. al., 2014. Deep captioning with multimodal recurrent neural networks]
[Vinyals et. al., 2014. Show and tell: Neural image caption generator]
[Karpathy and Li, 2015. Deep visual-semantic alignments for generating image descriptions] Andrew Ng
Sequence to
sequence models
% "&$ % ".$
"*, $
'( "&$ '(
% "&$ % "*+ $
Andrew Ng
Finding the most likely translation
Jane visite l’Afrique en septembre. /(' "&$ , … , ' "*, $ | %)
Andrew Ng
Why not a greedy search?
"*, $
'( "&$ '(
!"#$ ⋯ ⋯
% "&$ % "*+ $
Andrew Ng
Sequence to
sequence models
Beam search
deeplearning.ai
Beam search algorithm
Step 1
a 0(' "&$ | %)
⋮
'( "&$
in
⋮ !"#$ ⋯
10000 jane
⋮ % "&$ % "*+ $
september
⋮
zulu
Andrew Ng
Beam search algorithm
Step 1 Step 2
!"#$ ⋯
a
⋮ % "&$ % "*+ $
in
⋮
10000 jane
⋮ !"#$ ⋯
september
% "&$ % "*+ $
⋮
zulu
!"#$ ⋯
jane is !"#$ ⋯
% "&$ % "*+ $
"7$
jane visits '(
Refinements to
deeplearning.ai
beam search
Length normalization
45
45
45
Beam width B?
Andrew Ng
Sequence to
sequence models
Error analysis on
deeplearning.ai
beam search
Example
Jane visite l’Afrique en septembre.
!"#$ ⋯
% "&$ % "'( $
Andrew Ng
Error analysis on beam search
Human: Jane visits Africa in September. (+ ∗ )
Algorithm: Jane visited Africa last September. (+.)
Case 1:
Beam search chose +.. But + ∗ attains higher / + % .
Conclusion: Beam search is at fault.
Case 2:
+ ∗ is a better translation than +.. But RNN predicted / + ∗ % < / +. % .
Conclusion: RNN model is at fault.
Andrew Ng
Error analysis process
Human Algorithm / +∗ % / +. % At fault?
Bleu score
deeplearning.ai
(optional)
Evaluating machine translation
French: Le chat est sur le tapis.
[Papineni et. al., 2002. Bleu: A method for automatic evaluation of machine translation] Andrew Ng
Bleu score on bigrams
Example: Reference 1: The cat is on the mat.
Reference 2: There is a cat on the mat.
MT output: The cat the cat on the mat.
the cat
cat the
cat on
on the
the mat
[Papineni et. al., 2002. Bleu: A method for automatic evaluation of machine translation] Andrew Ng
Bleu score on unigrams
Example: Reference 1: The cat is on the mat.
Reference 2: There is a cat on the mat.
MT output: The cat the cat on the mat.
% 01234
56(7 (239:;<=) % 0123456(7 (3:;<=)
&'()*+,∈./ ')*+,∈./
!" = !' =
% 01234 (239:;<=) % 01234 (3:;<=)
&'()*+,∈./ ')*+,∈./
[Papineni et. al., 2002. Bleu: A method for automatic evaluation of machine translation] Andrew Ng
Bleu details
!' = Bleu score on n-grams only
Combined Bleu score:
[Papineni et. al., 2002. Bleu: A method for automatic evaluation of machine translation] Andrew Ng
Sequence to
sequence models
Attention model
deeplearning.ai
intuition
The problem of long sequences
"* $
'( "&$ '( ,
!"#$ ⋯ ⋯
% "&$ % "*+ $
Jane s'est rendue en Afrique en septembre dernier, a apprécié la culture et a rencontré beaucoup de
gens merveilleux; elle est revenue en parlant comment son voyage était merveilleux, et elle me tente
d'y aller aussi.
Jane went to Africa last September, and enjoyed the culture and met many wonderful people;
she came back raving about how wonderful her trip was, and is tempting me to go too.
Bleu
score
'( "&$ '( ".$ '( "/$ '( "1$ '( "0$
!"#$
Attention model
deeplearning.ai
Attention model
)"*$
[Bahdanau et. al., 2014. Neural machine translation by jointly learning to align and translate]
[Xu et. al., 2015. Show, attend and tell: Neural image caption generation with visual attention] Andrew Ng
Attention examples
July 20th 1969 1969 − 07 − 20
",,, .$
Visualization of + :
Andrew Ng
Audio data
Speech recognition
deeplearning.ai
Speech recognition problem
! #
audio clip transcript
Andrew Ng
Attention model for speech recognition
“T” “h”
% &'( % &)( ⋯
+&,( ⋯
Andrew Ng
CTC cost for speech recognition
(Connectionist temporal classification)
“the quick brown fox”
#. &'( #. &)( #. &',,,(
+&,( ⋯
Trigger word
deeplearning.ai
detection
What is trigger word detection?
Andrew Ng
Trigger word detection algorithm
!"#$
Andrew Ng
Conclusion
Summary and
deeplearning.ai
thank you
Specialization outline
Andrew Ng
Deep learning is a super power
Andrew Ng
Thank you.
-Andrew Ng
Andrew Ng