
Conditional Generation
by RNN & Attention
Hung-yi Lee
李宏毅

Outline
• Generation
• Attention
• Tips for Generation
• Pointer Network

Generation
Generating a structured object component-by-component

Generation
• Sentences are composed of characters/words
• Generating a character/word at each time by RNN
前
明
月
http://youtien.pixnet.net/blog/post/4604096-
%E6%8E%A8%E6%96%87%E6%8E%A5%E9%BE%8
D%E4%B9%8B%E5%B0%8D%E8%81%AF%E9%81
%8A%E6%88%B2
<BOS> w
1
w
2
w
3
……
……
……
P(w
1
)
P(w
2
|w
1
)
P(w
3
|w
1
,w
2
)
P(w
4
|w
1
,w
2
,w
3
)
床
床
前
明
sample

Generation
• Images are composed of pixels
• Generating a pixel at each time by RNN
blue
pink
blue
<BOS> w
1
w
2
w
3
……
……
……
P(w
1
)
P(w
2
|w
1
)
P(w
3
|w
1
,w
2
)
P(w
4
|w
1
,w
2
,w
3
)
red
Consider as a sentence
blue red yellow gray
……
Train a language model
based on the “sentences”
red
blue
pink