Personal Project
2018๋…„ 03์›” 09์ผ
์ „์„์›, ๊น€์ง€ํ—Œ, ๊น€ํ˜•์„ญ
Final Portfolio
Deep Dive into Deep Learning
: Exploration of CNN & RNN
2
Deep Dive into Deep Learning : Exploration of CNN & RNN
๋ชฉ์ฐจ
โ–  Summary
โ–  CNN โ€“ Animal Classification (Cat vs. Dog)
โ–  CNN โ€“ Leaf Classification (Healthy vs. Diseased)
โ–  RNN โ€“ Stock Price Prediction
3
Deep Dive into Deep Learning : Exploration of CNN & RNN
CNN/RNN ์ด๋ก ๊ณผ ์‹ค์Šต์˜ ๊ท ํ˜• ์žˆ๋Š” ํ•™์Šต์„ ์œ„ํ•ด CAT/DOG ์ด๋ฏธ์ง€
๋ถ„๋ฅ˜, ์ฃผ๊ฐ€ ์˜ˆ์ธก์„ ํ•˜๊ณ , CNN ์‘์šฉ์œผ๋กœ ์ดํŒŒ๋ฆฌ ์ด๋ฏธ์ง€๋ฅผ ๋ถ„๋ฅ˜ํ•จ
Summary
CNN Application RNN PracticeCNN Basic Practice II
Leaf ClassificationAnimal Classification Stock Price Prediction
์ •ํ™•๋„ : 98.8%์ •ํ™•๋„ : 97.8%
โ€ข Conv. Layer with Max Pool 4๊ฐœ
โ€ข Batch Norm applied
โ€ข Dropout : 0.5
โ€ข LR : 0.001
โ€ข Optimizer : Adam
โ€ข Batch Size : 100
โ€ข Conv. Layer with Max Pool 4๊ฐœ
โ€ข Batch Norm applied
โ€ข Dropout : 0.5
โ€ข LR : 0.001
โ€ข Optimizer : Adam
โ€ข Batch Size : 100
โ€ข LSTM with softsign
โ€ข Minmax scaling
โ€ข Dropout : 0.5
โ€ข LR : 0.001
โ€ข Optimizer : Adam
โ€ข Batch Size : 100
CNN Basic Practice I
4
Deep Dive into Deep Learning : Exploration of CNN & RNN
๋ชฉ์ฐจ
โ–  Summary
โ–  CNN โ€“ Animal Classification (Cat vs. Dog)
โ–  CNN โ€“ Leaf Classification (Healthy vs. Diseased)
โ–  RNN โ€“ Stock Price Prediction
5
Deep Dive into Deep Learning : Exploration of CNN & RNN
๊ธฐ.๋ณธ.์— ์ถฉ์‹คํ•˜์ž!
๊ธฐ.๋ณธ.์„ ๊ฐˆ๊ณ  ๋‹ฆ์ž!
๊ธฐ.๋ณธ.์ด ์ฐจ์ด๋ฅผ ๋งŒ๋“ ๋‹ค!
CNN์˜ ํ•„.์ˆ˜. ์ž….๋ฌธ.์ด๋ผ๊ณ  ํ•  ์ˆ˜ ์žˆ๋Š”
โ€œ๊ฐœ/๊ณ ์–‘์ด ๋ถ„๋ฅ˜โ€๋ฅผ ํ•ด๋ณผ๊นŒ?
6
Deep Dive into Deep Learning : Exploration of CNN & RNN
๋„Œ ๋ˆ„๊ตฌ๋ƒโ€ฆ?
๊ฐœ? ๊ณ ์–‘์ด?
๊ฐœ๋ƒฅ์ด!!!
7
Deep Dive into Deep Learning : Exploration of CNN & RNN
๊ฐœ/๊ณ ์–‘์ด ๋ถ„๋ฅ˜๋ฅผ ์œ„ํ•œ ๋ชจ๋ธ์€ ํฌ๊ฒŒ 4๊ฐœ์˜ Conv Layer์™€ 1๊ฐœ์˜
Convolutional & FC Layer๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ๋‹ค.
Structure Overview
Convolution
Batch
Normalization
Rectified
LinearUnit
MaxPooling
Convolution
Batch
Normalization
Rectified
LinearUnit
MaxPooling
Convolution
Batch
Normalization
Rectified
LinearUnit
MaxPooling
Convolution
Batch
Normalization
Rectified
LinearUnit
MaxPooling
Convolution
Convolution
Fully
Connected
Data Conv. 1 Conv. 2
Conv. 3Conv. 4Conv & FC
Drop Out : 0.5 Drop Out : 0.5
Drop Out : 0.5Drop Out : 0.5
Optimizer : Adam
Learning Rate: 0.001
Batch Size : 100
8
Deep Dive into Deep Learning : Exploration of CNN & RNN
Convolutional Layer1์˜ Graphical Description์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
10x10,
S: 1,
20
Filters
Convolutional Layer 1
Convolution
Batch
Normalization
Rectified
LinearUnit
MaxPooling
Batch
Norm
&
ReLU
(Max
Pool)
3x3,
S: 2,
P: SAME
9
Deep Dive into Deep Learning : Exploration of CNN & RNN
10x10,
S: 1,
40
Filters
Convolutional Layer 2
Convolution
Batch
Normalization
Rectified
LinearUnit
MaxPooling
Batch
Norm
&
ReLU
(Max Pool)
3x3,
S: 2,
P: SAME
Previous
Layer
Convolutional Layer2์˜ Graphical Description์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
10
Deep Dive into Deep Learning : Exploration of CNN & RNN
7x7,
S: 1,
60
Filters
Convolutional Layer 3
Convolution
Batch
Normalization
Rectified
LinearUnit
MaxPooling
32 x 32 x 60
(Max Pool)
3x3,
S: 2,
P: SAME
32 x 32 x 40
Previous
Layer
32 x 32 x 60
16 x 16 x 60
Convolutional Layer3์˜ Graphical Description์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
11
Deep Dive into Deep Learning : Exploration of CNN & RNN
Convolutional Layer 4
Convolution
Batch
Normalization
Rectified
LinearUnit
MaxPooling
16 x 16 x 60
16 x 16 x 80
5x5,
S: 1,
80
Filters
Previous
Layer
16 x 16 x 80
Batch
Norm
&
ReLU
8 x 8 x 80
(Max
Pool)
3x3,
S: 2,
P: SAME
Convolutional Layer4์˜ Graphical Description์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
12
Deep Dive into Deep Learning : Exploration of CNN & RNN
Convolutional & Fully Connected Layer
Fully
Connected
Convolution
Convolution
Previous
Layer
0.3
โ‹ฎ
0.5
(FC)
(8*8*100)x
200
8 x 8 x 80
PreviousLayer
8 x 8 x 100
3x3,
S: 1,
100
Filters
8 x 8 x 100
(FC)
(8*8*100)x200
3x3,
S: 1,
100
Filters
1
0
(FC)
(8*8*100)x
200
(FC)
200x2
200x1 2x1
Conv & FC Layer์˜ Graphical Description์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
13
Deep Dive into Deep Learning : Exploration of CNN & RNN
๋ถ„์„ ๊ฒฐ๊ณผ
์ •ํ™•๋„ : 97.83%
14
Deep Dive into Deep Learning : Exploration of CNN & RNN
๋ชฉ์ฐจ
โ–  Summary
โ–  CNN โ€“ Animal Classification (Cat vs. Dog)
โ–  CNN โ€“ Leaf Classification (Healthy vs. Diseased)
โ–  RNN โ€“ Stock Price Prediction
15
Deep Dive into Deep Learning : Exploration of CNN & RNN
CIFAR10๊ณผ ๊ฐœ๋ƒฅ์ด ๋ถ„๋ฅ˜๋ฅผ ํ•ด๋ณด๋‹ˆ ์ด์ œ
CNN์— ์ข€ ์ต์ˆ™ํ•ด์ง„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
(๋ฟŒ๋“ฏ๋ฟŒ๋“ฏ^^)
์ด์ œ๋Š” ์ง€๊ธˆ๊ป ๊ฐˆ๊ณ  ๋‹ฆ์€
๊ธฐ์ˆ ์„ ํ™œ์šฉํ•ด ๋ณผ ๋‹จ๊ณ„!
16
Deep Dive into Deep Learning : Exploration of CNN & RNN
๋ญ˜ ํ• ๊นŒ? (๊ณ ๋ฏผ๊ณ ๋ฏผ)
โ€ฆ
โ€ฆ
IDEA
IDEA
IDEA
IDEA
IDEA
17
Deep Dive into Deep Learning : Exploration of CNN & RNN
(1) ์ œํ•œ๋œ ์‹œ๊ฐ„ ๋‚ด์— ํ•  ์ˆ˜ ์žˆ๋Š”,
(2) ๋‚˜์˜ ์ด๋ ฅ์— ๋„์›€์ด ๋˜๋Š”,
(3) ์žฌ๋ฏธ์žˆ๋Š” ์ฃผ์ œ๊ฐ€ ๋ญ๊ฐ€ ์žˆ์„๊นŒโ€ฆ?!
์š”์ฆ˜ ์ œ์กฐ์—…์—์„œ ๊ณต์žฅ์ž๋™ํ™”๋ฅผ ๋„˜์–ด
Smart Factory ์‚ฌ์—…์„
์ถ”์ง„ํ•œ๋‹ค๋Š”๋ฐโ€ฆ!
18
Deep Dive into Deep Learning : Exploration of CNN & RNN
Smart Factory์˜ CNN ํ™œ์šฉ์€?!
์ œํ’ˆ ๋ถˆ๋Ÿ‰ํ’ˆ ๊ฒ€์ถœ!
๊ฐ€์ž!!!
๊ฐ€์ž!!
๊ฐ€์ž!
:
๋ฐ์ดํ„ฐ๊ฐ€ ์—†๋‹คโ€ฆ!
19
Deep Dive into Deep Learning : Exploration of CNN & RNN
๊ณต์žฅ ์ œํ’ˆ ๋ฐ์ดํ„ฐ๊ฐ€ ์—†์œผ๋ฉด, ๊ทธ
๋Œ€์•ˆ์œผ๋กœ โ€œ์•„ํ”ˆ ์ดํŒŒ๋ฆฌ vs. ๊ฑด๊ฐ•ํ•œ
์ดํŒŒ๋ฆฌโ€ ๋ฅผ ๋ถ„๋ฅ˜ํ•ด ๋ณด๋Š” ๊ฒƒ๋„ ์ข‹์„
๊บผ์•ผ! ๋น„์Šทํ•˜์ž–์•„?
ITWILL
๋”ฅ๋Ÿฌ๋‹ ์ „์ž„๊ฐ•์‚ฌ
์Šค๋งˆํŠธํŒฉํ† ๋ฆฌ ๋ถ„์•ผ
๋”ฅ๋Ÿฌ๋‹ ์ „๋ฌธ ์—ฐ๊ตฌ์›
๋งž์Šต๋‹ˆ๋‹ค! ๊ทธ๋ ‡์Šต๋‹ˆ๋‹ค!!
์ข‹์•„! ๊ทธ๋Ÿผ ์•„ํ”ˆ ์ดํŒŒ๋ฆฌ๋ฅผ ๋ชจ์กฐ๋ฆฌ
๊ฒ€์ถœํ•ด ๋ด…์‹œ๋‹ค!
ํ˜น ์ด ๊ธ€์„ ์ฝ์œผ์‹œ๋Š” ๋”ฅ๋Ÿฌ๋‹ ์ „๋ฌธ๊ฐ€ ๋ถ„๋“ค๊ป˜.
์šฐ๋ฆฌ๋‚˜๋ผ์˜ ๋”ฅ๋Ÿฌ๋‹ ๊ต์œก์„ ์œ„ํ•ด ๊ต์œก์šฉ ๋ฐ์ดํ„ฐ ์ข€ ๊ณต๊ฐœํ•ด ์ฃผ์„ธ์š”! ์–ธ์ œ๊นŒ์ง€ ๋ฏธ๊ตญ ๋ฐ์ดํ„ฐ ์จ์•ผ ํ•˜๋‚˜์š”โ€ฆใ… ใ…  ๊ต์œก์ด ํž˜์ž…๋‹ˆ๋‹ค!
20
Deep Dive into Deep Learning : Exploration of CNN & RNN
Structure Overview
Convolution
Batch
Normalization
Rectified
LinearUnit
MaxPooling
Convolution
Batch
Normalization
Rectified
LinearUnit
MaxPooling
Convolution
Batch
Normalization
Rectified
LinearUnit
MaxPooling
Convolution
Batch
Normalization
Rectified
LinearUnit
MaxPooling
Data Conv. 1 Conv. 2
Conv. 3Conv. 4Conv & FC
Drop Out : 0.5 Drop Out : 0.5
Drop Out : 0.5Drop Out : 0.5
Batch Size : 100
Fully
Connected
Convolution
MaxPooling
Convolution
Optimizer : Adam
Learning Rate: 0.001
๋ณ‘๋“  ์ดํŒŒ๋ฆฌ๋ฅผ ์ฐพ๊ธฐ ์œ„ํ•œ ๋ชจ๋ธ์€ 4๊ฐœ์˜ Conv. Layer์™€ 1๊ฐœ์˜
Conv+FC ์กฐํ•ฉ Layer๋กœ ๊ตฌ์„ฑ๋œ๋‹ค.
21
Deep Dive into Deep Learning : Exploration of CNN & RNN
10x10,
S: 1,
20
Filters
Convolutional Layer 1
Convolution
Batch
Normalization
Rectified
LinearUnit
MaxPooling
Batch
Norm
&
ReLU
(Max
Pool)
3x3,
S: 2,
P: SAME
Original Image Re-coloring
Background
Pre-Processing Data
ํšจ๊ณผ์ ์ด๊ณ  ํšจ์œจ์ ์ธ
๋ถ„์„์„ ์œ„ํ•ด ๋ชจ๋“ 
์ด๋ฏธ์ง€์˜ ๋ฐฐ๊ฒฝ์ƒ‰์„
๊ฒ€์ •์ƒ‰์œผ๋กœ ํ†ต์ผํ•จ
Conv 1์ธต์˜ Graphical Description์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
22
Deep Dive into Deep Learning : Exploration of CNN & RNN
10x10,
S: 1,
40
Filters
Convolutional Layer 2
Convolution
Batch
Normalization
Rectified
LinearUnit
MaxPooling
Batch
Norm
&
ReLU
(Max Pool)
3x3,
S: 2,
P: SAME
Previous
Layer
Conv 2์ธต์˜ Graphical Description์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
23
Deep Dive into Deep Learning : Exploration of CNN & RNN
10x10,
S: 1,
60
Filters
Convolutional Layer 3
Convolution
Batch
Normalization
Rectified
LinearUnit
MaxPooling
64 x 64 x 60
(Max
Pool)
3x3,
S: 2,
P: SAME
64 x 64 x 40
Previous
Layer
64 x 64 x 60
32 x 32 x 60
Conv 3์ธต์˜ Graphical Description์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
24
Deep Dive into Deep Learning : Exploration of CNN & RNN
Convolutional Layer 4
Convolution
Batch
Normalization
Rectified
LinearUnit
MaxPooling
32 x 32 x 60
32 x 32 x 80
10x10,
S: 1,
80
Filters
Previous
Layer
32 x 32 x 80
Batch
Norm
&
ReLU
16 x 16 x 80
(Max Pool)
3x3,
S: 2,
P: SAME
Conv 4์ธต์˜ Graphical Description์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
25
Deep Dive into Deep Learning : Exploration of CNN & RNN
Convolutional & Fully Connected Layer
Previous
Layer
16 x 16 x 80
PreviousLayer
16 x 16 x 100 8 x 8 x 100
(FC)
(8*8*100)x200
10x10,
S: 1,
100
Filters
(FC)
200x2
200x1
2x1
Fully
Connected
Convolution
MaxPooling
Convolution
10x10,
S: 1,
200
Filters
(Max
Pool)
3x3,
S: 2,
P: SAME
8 x 8 x 100
0.3
0.1
0.7
โ‹ฎ
0.9
โ‹ฎ
0.3
โ‹ฎ
0.2
0.6
0.5
0.8
0.3
(Conv+FC) ์ธต์˜ Graphical Description์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
26
Deep Dive into Deep Learning : Exploration of CNN & RNN
๋ถ„์„ ๊ฒฐ๊ณผ
์ •ํ™•๋„ : 98.80%
27
Deep Dive into Deep Learning : Exploration of CNN & RNN
๋ชฉ์ฐจ
โ–  Summary
โ–  CNN โ€“ Animal Classification (Cat vs. Dog)
โ–  CNN โ€“ Leaf Classification (Healthy vs. Diseased)
โ–  RNN โ€“ Stock Price Prediction
28
Deep Dive into Deep Learning : Exploration of CNN & RNN
์ด๋ฒˆ์—๋Š” ๋”ฅ๋Ÿฌ๋‹์˜ ๊ฝƒ ์ด๋ผ๋Š”
RNN์„ ํ•œ ๋ฒˆ ํ•ด๋ณด์ž!
๊ทธ๋Ÿฐ๋ฐ RNN์ด ๋ญ์ง€?
29
Deep Dive into Deep Learning : Exploration of CNN & RNN
Recurrent
Neural
Net ์ˆœํ™˜ ์‹ ๊ฒฝ๋ง
(์ถœ์ฒ˜ : ๋„ค์ด๋ฒ„ ์–ดํ•™์‚ฌ์ „)
30
Deep Dive into Deep Learning : Exploration of CNN & RNN
์ด ์„ธ์ƒ์—” ์ด๋ฏธ์ง€์ฒ˜๋Ÿผ ๊ณ ์ •๋˜์–ด ์žˆ๋Š” ๊ฒƒ๋ณด๋‹ค
์‹œ๊ฐ„์ˆœ์„œ๋ฅผ ๊ฐ–๋Š” ๋ฐ์ดํ„ฐ๊ฐ€ ํ›จ~์”ฌ ๋งŽ๋‹ค
๋ฐ”๋กœ ์ด๋Ÿฐ ์ˆœ์„œ๋ฅผ ๊ฐ–๋Š” ๋ฐ์ดํ„ฐ๋ฅผ
์ฒ˜๋ฆฌํ•˜๋Š” ์‹ ๊ฒฝ๋ง์ด RNN!
31
Deep Dive into Deep Learning : Exploration of CNN & RNN
์ด์ „์— ์ž…๋ ฅ ๋ฐ›์€ ๋ฐ์ดํ„ฐ์˜
์ •๋ณด๋ฅผ ๋ฒ„๋ฆฌ์ง€ ์•Š๊ณ ,
๊ทธ ๋‹ค์Œ์˜ ์ž…๋ ฅํ• 
๋ฐ์ดํ„ฐ์— ๋‹ค์‹œ ๋”ํ•ด์„œ ์—ฐ์‚ฐ์—
์‚ฌ์šฉํ•œ๋‹ค.
๊ทธ๋ž˜์„œ
โ€œ์ˆœํ™˜!!โ€
๋‹ค์‹œ ๋งํ•˜๋ฉด,
32
Deep Dive into Deep Learning : Exploration of CNN & RNN
RNN์˜ Forward
Propagation์„ ๋ณด์—ฌ์ฃผ๊ธฐ
์œ„ํ•ด ์ˆœํ™˜์„ ๋ฐ˜์˜ํ•œ CELL์„
๋„์‹ํ™”ํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
A
๐‘ฟ ๐’•
๐’‰ ๐’•
์—ฌ๊ธฐ์„œ CELL์ด๋ž€, ์ˆœํ™˜
๊ฐœ๋…์„ ๋‚ดํฌํ•œ ํ•˜๋‚˜์˜
Hidden Layer๋ผ๊ณ  ์ƒ๊ฐํ•˜์ž.
33
Deep Dive into Deep Learning : Exploration of CNN & RNN
๋„์‹ํ™”๋œ CELL์ด ์•Œ ๋“ฏ ํ•˜๋ฉด์„œ ์ƒ์†Œํ•˜๋‹ค!
์ด๋ฅผ ํ’€์–ด์„œ ๊ทธ๋ ค๋ณด๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
A
๐‘ฟ ๐’•
๐’‰ ๐’•
๐‘ฟ ๐ŸŽ
๐’‰ ๐ŸŽ
A
๐‘ฟ ๐Ÿ
๐’‰ ๐Ÿ
A
๐‘ฟ ๐Ÿ
๐’‰ ๐Ÿ
A
๐‘ฟ ๐’•
๐’‰ ๐’•
A
โ€ฆ
=
๊ทธ๋ฆฌ๊ณ  ํ’€์–ด์ง„ ๊ฐ ํ•˜๋‚˜ํ•˜๋‚˜๋ฅผ ํ•œ Sequence์ด๋‹ค.
Cell Sequence
34
Deep Dive into Deep Learning : Exploration of CNN & RNN
2๊ฐœ์˜ Cell, ์ฆ‰ 2๊ฐœ์˜ Layer๋กœ ํ™•์žฅํ•œ ์ถœ๋ ฅ์ธต๊ณผ ์‚ฐ์ถœ์‹์€
๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
A
๐‘ฟ ๐’• ๐‘ฟ ๐ŸŽ
A
๐‘ฟ ๐Ÿ
A
๐‘ฟ ๐Ÿ
A
๐‘ฟ ๐’•
A
โ€ฆ
=A A A A A
๐’š ๐’• ๐’š ๐ŸŽ ๐’š ๐Ÿ ๐’š ๐Ÿ ๐’š ๐’•
โ€ฆ
๐’‰ ๐’• = ๐’•๐’‚๐’๐’‰(๐‘พ ๐’‰๐’‰ ๐’‰ ๐’•โˆ’๐Ÿ + ๐‘พ ๐’™๐’‰ ๐’™ ๐’• + ๐’ƒ ๐’‰)
๐’š ๐’• = ๐‘พ ๐’‰๐’š ๐’‰ ๐’• + ๐’ƒ ๐’š
35
Deep Dive into Deep Learning : Exploration of CNN & RNN
๋‹ค์Œ 1๊ฐœ Cell์˜ Forward Propagation ์ˆ˜์‹์„
๊ทธ๋ž˜ํ”„๋กœ ํ‘œํ˜„ํ•ด ๋ณด์ž.
( ์ถœ์ฒ˜: ratsgoโ€™s blog for textmining, https://ratsgo.github.io/natural%20language%20processing/2017/03/09/rnnlstm/ )
๐’‰ ๐’• = ๐’•๐’‚๐’๐’‰(๐‘พ ๐’‰๐’‰ ๐’‰ ๐’•โˆ’๐Ÿ + ๐‘พ ๐’™๐’‰ ๐’™ ๐’• + ๐’ƒ ๐’‰)
๐’š ๐’• = ๐‘พ ๐’‰๐’š ๐’‰ ๐’• + ๐’ƒ ๐’š
๐‘ฅ ๐‘ก
๐‘Š๐‘ฅโ„Ž
๐‘Šโ„Žโ„Ž
โ„Ž ๐‘กโˆ’1
ร—
ร—
+
๐‘โ„Ž
๐‘ก๐‘Ž๐‘›โ„Ž
๐‘Šโ„Ž๐‘ฆ
ร—
๐‘ ๐‘ฆ
+
โ„Ž ๐‘ก
๐‘ฆ๐‘ก
โ„Ž ๐‘ก
์ƒ๊ฐ๋ณด๋‹ค
๋ณต์žกํ•˜์ง€
์•Š๋‹ค!
36
Deep Dive into Deep Learning : Exploration of CNN & RNN
Forward Propagation์ด ์žˆ์œผ๋‹ˆ ๋‹น์—ฐํžˆ
Backward Propagation๋„ ์žˆ์„ ๊ฒƒ์ด๋‹ค.
37
Deep Dive into Deep Learning : Exploration of CNN & RNN
๐’‰ ๐’• = ๐’•๐’‚๐’๐’‰(๐‘พ ๐’‰๐’‰ ๐’‰ ๐’•โˆ’๐Ÿ + ๐‘พ ๐’™๐’‰ ๐’™ ๐’• + ๐’ƒ ๐’‰)
๐’š ๐’• = ๐‘พ ๐’‰๐’š ๐’‰ ๐’• + ๐’ƒ ๐’š
๐‘ฅ ๐‘ก
๐‘Š๐‘ฅโ„Ž
๐‘Šโ„Žโ„Ž
โ„Ž ๐‘กโˆ’1
ร—
ร—
+
๐‘โ„Ž
๐‘ก๐‘Ž๐‘›โ„Ž
๐‘Šโ„Ž๐‘ฆ
ร—
๐‘ ๐‘ฆ
+
โ„Ž ๐‘Ÿ๐‘Ž๐‘ค
๐‘ฆ๐‘ก
โ„Ž ๐‘ก
๐‘‘๐‘ฆ๐‘ก
๐‘‘๐‘ฆ๐‘ก
๐‘‘๐‘ฆ๐‘ก
โ„Ž ๐‘ก ร— ๐‘‘๐‘ฆ๐‘ก
โ„Ž ๐‘ก
๐‘Šโ„Ž๐‘ฆ ร— ๐‘‘๐‘ฆ๐‘ก
(1 โˆ’ ๐‘ก๐‘Ž๐‘›โ„Ž2
โ„Ž ๐‘Ÿ๐‘Ž๐‘ค ) ร— ๐‘‘โ„Ž ๐‘ก
๐‘‘โ„Ž ๐‘Ÿ๐‘Ž๐‘ค
๐‘‘โ„Ž ๐‘Ÿ๐‘Ž๐‘ค
๐‘‘โ„Ž ๐‘Ÿ๐‘Ž๐‘ค
๐‘‘โ„Ž ๐‘Ÿ๐‘Ž๐‘ค
๐‘ฅ ๐‘ก ร— ๐‘‘โ„Ž ๐‘Ÿ๐‘Ž๐‘ค
๐‘Š๐‘ฅโ„Ž ร— ๐‘‘โ„Ž ๐‘Ÿ๐‘Ž๐‘ค
โ„Ž ๐‘กโˆ’1 ร— ๐‘‘โ„Ž ๐‘Ÿ๐‘Ž๐‘ค
๐‘Šโ„Žโ„Ž ร— ๐‘‘โ„Ž ๐‘Ÿ๐‘Ž๐‘ค
( ์ถœ์ฒ˜: ratsgoโ€™s blog for textmining, https://ratsgo.github.io/natural%20language%20processing/2017/03/09/rnnlstm/ )
์•„๋‹ˆ๋‹ค...
๋ณต์žกํ•˜๊ธด
ํ•˜๋‹คโ€ฆ
์‹œ๊ฐ„์„ ๊ฑฐ์Šฌ๋Ÿฌ ๊ฐ€๋ฉด์„œ ์—ญ์ „ํŒŒ๋ฅผ ์ง„ํ–‰ํ•˜๋ฏ€๋กœ
Back Propagation Through Time(BPTT) ๋ผ๊ณ  ๋ถ€๋ฅธ๋‹ค.
38
Deep Dive into Deep Learning : Exploration of CNN & RNN
๐’‰ ๐’• = ๐’•๐’‚๐’๐’‰(๐‘พ ๐’‰๐’‰ ๐’‰ ๐’•โˆ’๐Ÿ + ๐‘พ ๐’™๐’‰ ๐’™ ๐’• + ๐’ƒ ๐’‰)
๐’š ๐’• = ๐‘พ ๐’‰๐’š ๐’‰ ๐’• + ๐’ƒ ๐’š
๐‘ฅ ๐‘ก
๐‘Š๐‘ฅโ„Ž
๐‘Šโ„Žโ„Ž
ร—
ร—
+
๐‘โ„Ž
๐‘ก๐‘Ž๐‘›โ„Ž
๐‘Šโ„Ž๐‘ฆ
ร—
๐‘ ๐‘ฆ
+
โ„Ž ๐‘ก
๐‘Ÿ๐‘Ž๐‘ค
๐‘ฆ๐‘ก
๐’‰ ๐’•
๐‘‘๐‘ฆ๐‘ก
๐‘‘๐‘ฆ๐‘ก
๐‘‘๐‘ฆ๐‘ก
โ„Ž ๐‘ก ร— ๐‘‘๐‘ฆ๐‘ก
โ„Ž ๐‘ก
๐‘Šโ„Ž๐‘ฆ ร— ๐‘‘๐‘ฆ๐‘ก
(1 โˆ’ ๐‘ก๐‘Ž๐‘›โ„Ž2
โ„Ž ๐‘ก
๐‘Ÿ๐‘Ž๐‘ค
) ร— ๐‘‘โ„Ž ๐‘ก
๐‘‘โ„Ž ๐‘ก
๐‘Ÿ๐‘Ž๐‘ค
๐‘‘โ„Ž ๐‘ก
๐‘Ÿ๐‘Ž๐‘ค
๐‘‘โ„Ž ๐‘ก
๐‘Ÿ๐‘Ž๐‘ค
๐‘‘โ„Ž ๐‘ก
๐‘Ÿ๐‘Ž๐‘ค
๐‘ฅ ๐‘ก ร— ๐‘‘โ„Ž ๐‘Ÿ๐‘Ž๐‘ค
๐‘ก
๐‘Š๐‘ฅโ„Ž ร— ๐‘‘โ„Ž ๐‘ก
๐‘Ÿ๐‘Ž๐‘ค
โ„Ž ๐‘กโˆ’1 ร— ๐‘‘โ„Ž ๐‘ก
๐‘Ÿ๐‘Ž๐‘ค
๐‘Šโ„Žโ„Ž ร— ๐‘‘โ„Ž ๐‘ก
๐‘Ÿ๐‘Ž๐‘ค
( ์ถœ์ฒ˜: ratsgoโ€™s blog for textmining, https://ratsgo.github.io/natural%20language%20processing/2017/03/09/rnnlstm/ )
ํ•œ Cell์—์„œ ๋ฏธ๋ถ„ํ•˜๋Š” Parameter๊ฐ€ ๋ณ€ํ•˜์ง€ ์•Š์•„, ๊ตฌ์กฐ์ƒ
๊ฑฐ์Šฌ๋Ÿฌ ์˜ฌ๋ผ๊ฐ€๋ฉด์„œ ํ™œ์„ฑํ™”ํ•จ์ˆ˜๋ฅผ ์—ฌ๋Ÿฌ ๋ฒˆ ๋ฏธ๋ถ„ํ•˜๊ฒŒ ๋œ๋‹ค
โ„Ž ๐‘กโˆ’1
โ€œ์ˆœํ™˜โ€ ๊ตฌ์กฐ์ด๋ฏ€๋กœ
๐’‰ ๐’• ์ฒ˜๋Ÿผ ๐’‰ ๐’•โˆ’๐Ÿ์ด ์ด
์ „ Sequence๋กœ
Back Propagation
๋œ๋‹ค.
39
Deep Dive into Deep Learning : Exploration of CNN & RNN
๐’™ ๐’•โˆ’๐Ÿ
๐‘พ ๐’™๐’‰
๐‘พ ๐’‰๐’‰
๐’‰ ๐’•โˆ’๐Ÿ
ร—
ร—
+
๐‘โ„Ž
๐‘ก๐‘Ž๐‘›โ„Ž
๐‘Šโ„Ž๐‘ฆ
ร—
๐‘ ๐‘ฆ
+
โ„Ž ๐‘กโˆ’1
๐‘Ÿ๐‘Ž๐‘ค
๐‘ฆ๐‘กโˆ’1
๐’‰ ๐’•โˆ’๐Ÿ
๐‘‘๐‘ฆ๐‘กโˆ’1
๐‘‘๐‘ฆ๐‘กโˆ’1
๐‘‘๐‘ฆ๐‘กโˆ’1
โ„Ž ๐‘กโˆ’1 ร— ๐‘‘๐‘ฆ๐‘กโˆ’1
โ„Ž ๐‘กโˆ’1
๐‘Šโ„Ž๐‘ฆ ร— ๐‘‘๐‘ฆ๐‘กโˆ’1
(1 โˆ’ ๐‘ก๐‘Ž๐‘›โ„Ž2
โ„Ž ๐‘กโˆ’1
๐‘Ÿ๐‘Ž๐‘ค
) ร— ๐’…๐’‰ ๐’•โˆ’๐Ÿ
๐‘‘โ„Ž ๐‘กโˆ’1
๐‘Ÿ๐‘Ž๐‘ค
๐‘‘โ„Ž ๐‘กโˆ’1
๐‘Ÿ๐‘Ž๐‘ค
๐‘‘โ„Ž ๐‘กโˆ’1
๐‘Ÿ๐‘Ž๐‘ค
๐‘‘โ„Ž ๐‘กโˆ’1
๐‘Ÿ๐‘Ž๐‘ค
๐‘ฅ ๐‘กโˆ’1 ร— ๐‘‘โ„Ž ๐‘กโˆ’1
๐‘Ÿ๐‘Ž๐‘ค
๐‘พ ๐’™๐’‰ ร— ๐’…๐’‰ ๐’•โˆ’๐Ÿ
๐’“๐’‚๐’˜
โ„Ž ๐‘กโˆ’2 ร— ๐‘‘โ„Ž ๐‘กโˆ’1
๐‘Ÿ๐‘Ž๐‘ค
๐‘พ ๐’‰๐’‰ ร— ๐’…๐’‰ ๐’•โˆ’๐Ÿ
๐’“๐’‚๐’˜
( ์ถœ์ฒ˜: ratsgoโ€™s blog for textmining, https://ratsgo.github.io/natural%20language%20processing/2017/03/09/rnnlstm/ )
(๐‘ก์‹œ์ ์œผ๋กœ ๋ถ€ํ„ฐ์˜
์—ญ ์ „ํŒŒ ๊ฒฐ๊ณผ)
ํ•œ Cell์—์„œ ๋ฏธ๋ถ„ํ•˜๋Š” Parameter๊ฐ€ ๋ณ€ํ•˜์ง€ ์•Š์•„, ๊ตฌ์กฐ์ƒ
๊ฑฐ์Šฌ๋Ÿฌ ์˜ฌ๋ผ๊ฐ€๋ฉด์„œ ํ™œ์„ฑํ™”ํ•จ์ˆ˜๋ฅผ ์—ฌ๋Ÿฌ ๋ฒˆ ๋ฏธ๋ถ„ํ•˜๊ฒŒ ๋œ๋‹ค
๐‘พ ๐’‰๐’š ร— ๐’…๐’š๐’•โˆ’๐Ÿ + ๐’…๐’‰ ๐’•โˆ’๐Ÿ
์•ž ์‹œ์ ์œผ๋กœ๋ถ€ํ„ฐ ์˜ค๋Š” ๐’‰๐’•โˆ’๐Ÿ์˜ ์—ญ์ „ํŒŒ ๊ฐ’๊ณผ
Loss๋กœ๋ถ€ํ„ฐ ์˜ค๋Š” ๐’‰๐’•โˆ’๐Ÿ์˜ ์—ญ์ „ํŒŒ ๊ฐ’์„ ํ•ฉํ•œ๋‹ค.
40
Deep Dive into Deep Learning : Exploration of CNN & RNN
A
๐‘ฟ ๐’•
๐’‰ ๐’•RNN์€ CNN๊ณผ ๋‹ฌ๋ฆฌ
Activation Function์œผ๋กœ
Hyperbolic Tangent๊ฐ€
์ผ๋ฐ˜์ ์ด๋‹ค.
๐’‰ ๐’• = ๐’•๐’‚๐’๐’‰(๐‘พ ๐’‰๐’‰ ๐’‰๐’•โˆ’๐Ÿ + ๐‘พ ๐’™๐’‰ ๐’™ ๐’• + ๐’ƒ ๐’‰)
์•„?
์™œ์ฃ ???
41
Deep Dive into Deep Learning : Exploration of CNN & RNN
0
1
2
3
4
5
6
-6 -4 -2 0 2 4 6
Rectified Linear Unit
๐’‡ ๐’› = แ‰Š
๐ŸŽ, ๐’› โ‰ค ๐ŸŽ
๐’›, ๐’› > ๐ŸŽ
-1.5
-1
-0.5
0
0.5
1
1.5
-6 -4 -2 0 2 4 6
Hyperbolic Tangent
๐’•๐’‚๐’๐’‰(๐’™) =
๐’† ๐’™
โˆ’ ๐’†โˆ’๐’™
๐’† ๐’™ + ๐’†โˆ’๐’™
Forward Propagation ์—์„œ ์‚ฐ์ถœ๋  ์ˆ˜ ์žˆ๋Š” ๊ฐ’์˜ ๋ฒ”์œ„๋Š” ReLU๋กœ ์ธํ•ด 0์ด์ƒ์œผ๋กœ
์ œํ•œ๋˜์ง€๋งŒ, tanh๋Š” ๊ทธ ์ œ์•ฝ์ด ์—†์–ด ์ถ”์ •๋  ์ˆ˜ ์žˆ๋Š” W์™€ b์˜ Parameter๊ฐ’์˜ ์ œ์•ฝ์ด ์—†๋‹ค.
42
Deep Dive into Deep Learning : Exploration of CNN & RNN
์ง€๊ธˆ๊นŒ์ง€ ์„ค๋ช…ํ•œ ๊ตฌ์กฐ๋ฅผ Vanilla RNN ์ด๋ผ ํ•œ๋‹ค.
Sequence๊ฐ€ ๊ธด ๊ตฌ์กฐ์—์„œ Vanilla RNN์€ Gradient๊ฐ€ ์ ์ 
๊ฐ์†Œ/๋ฐœ์‚ฐํ•˜๋Š” Vanishing/Exploding Gradient Problem์ด
๋ฐœ์ƒํ•œ๋‹ค. ์ฆ‰, ์˜ค๋ž˜๋œ ๊ณผ๊ฑฐ์˜ ์ •๋ณด๋ฅผ ํ•™์Šตํ•˜์ง€ ๋ชปํ•œ๋‹ค.
์ด๋Ÿฌํ•œ ๋ฌธ์ œ๋ฅผ ์™„ํ™”์‹œํ‚ค๊ธฐ ์œ„ํ•ด ๋‚˜์˜จ ๋ชจ๋ธ์ด
Long Short Term Memory(LSTM) ์ด๋‹ค.
43
Deep Dive into Deep Learning : Exploration of CNN & RNN
LSTM ์˜ ๊ธฐ๋ณธ ๊ตฌ์กฐ๋Š” Vanilla RNN ๊ตฌ์กฐ์™€ ์œ ์‚ฌํ•˜๋‚˜,
Cell ๋‚ด๋ถ€ ๊ตฌ์กฐ๊ฐ€ ์กฐ๊ธˆ ๋” ๋ณต์žกํ•˜๋‹ค.
๐ˆ ๐ˆ ๐ˆtanh
tanh
๐ˆ ๐ˆ ๐ˆtanh
tanh
๐ˆ ๐ˆ ๐ˆtanh
tanh
๐‘ฟ ๐ŸŽ ๐‘ฟ ๐Ÿ ๐‘ฟ ๐Ÿ
๐’‰ ๐ŸŽ ๐’‰ ๐Ÿ ๐’‰ ๐Ÿ
44
Deep Dive into Deep Learning : Exploration of CNN & RNN
LSTM
๐’‡ ๐’• = ๐ˆ ๐‘พ ๐’™๐’‰_๐’‡ ๐’™๐’• + ๐‘พ ๐’‰๐’‰_๐’‡ ๐’‰๐’•โˆ’๐Ÿ + ๐’ƒ ๐’‰_๐’‡
๐ˆ ๐ˆ ๐ˆtanh
tanh
๐‘ฟ ๐’•
๐’‰ ๐’•
๐’„ ๐’•โˆ’๐Ÿ
๐’‡ ๐’• ๐’Š๐’• ๐’ˆ ๐’• ๐’๐’•
๐’„ ๐’•
๐’‰ ๐’•
LSTM์˜ ๊ธฐ๋ณธ ๊ตฌ์กฐ๋ฅผ ์‚ดํŽด๋ณด๋ฉด, Sequence ๊ฐ„ ์—ฐ๊ฒฐ์„ ํ•˜๋Š”
๐’„ ๐’•๋Š” ์—ฐ์‚ฐ์ด ๋ง์…ˆ์œผ๋กœ ๋˜์–ด ์žˆ์–ด ์žฅ๊ธฐ๊ฐ„ ํ•™์Šต์ด ๊ฐ€๋Šฅํ•˜๋‹ค!
๐’Š๐’• = ๐ˆ ๐‘พ ๐’™๐’‰_๐’Š ๐’™๐’• + ๐‘พ ๐’‰๐’‰_๐’Š ๐’‰ ๐’•โˆ’๐Ÿ + ๐’ƒ ๐’‰_๐’Š
๐’๐’• = ๐ˆ ๐‘พ ๐’™๐’‰_๐’ ๐’™๐’• + ๐‘พ ๐’‰๐’‰_๐’ ๐’‰ ๐’•โˆ’๐Ÿ + ๐’ƒ ๐’‰_๐’
๐’ˆ ๐’• = ๐’•๐’‚๐’๐’‰ ๐‘พ ๐’™๐’‰_๐’ˆ ๐’™๐’• + ๐‘พ ๐’‰๐’‰_๐’ˆ ๐’‰ ๐’•โˆ’๐Ÿ + ๐’ƒ ๐’‰_๐’ˆ
๐’„ ๐’• = ๐’‡ ๐’•โŠ™๐’„ ๐’•โˆ’๐Ÿ + ๐’Š๐’•โŠ™๐’ˆ ๐’•
๐’‰ ๐’• = ๐’๐’•โŠ™๐’•๐’‚๐’๐’‰(๐’„ ๐’•)
45
Deep Dive into Deep Learning : Exploration of CNN & RNN
์ž, ์ด์ œ RNN์— ๋Œ€ํ•œ ๊ธฐ๋ณธ์ ์ธ ์ด๋ก ์€
๋‹ค๋ฃจ์—ˆ๊ณ , ๊ฐ„๋‹จํ•œ ์‹ค์Šต์„ ํ†ตํ•ด ์‹ค์งˆ์ ์ธ
Working Knowledge๋ฅผ ์Œ“์•„๋ณด์ž!
46
Deep Dive into Deep Learning : Exploration of CNN & RNN
RNN์œผ๋กœ ํ•  ์ˆ˜ ์žˆ๋Š” ๋Œ€ํ‘œ์ ์ธ ์—ฐ๊ตฌ ๋ถ„์•ผ๋Š”,
1.์ž์—ฐ์–ด์ฒ˜๋ฆฌ(๋ฒˆ์—ญ, ์ฑ—๋ด‡, ์‹œ์“ฐ๊ธฐโ€ฆ)
2.์‹œ๊ณ„์—ด ์˜ˆ์ธก(์ฃผ๊ฐ€)
3.์Œ์„ฑ์ธ์‹
๋“ฑ๋“ฑโ€ฆ ๋งŽ๋‹ค!
47
Deep Dive into Deep Learning : Exploration of CNN & RNN
์ด ์ค‘์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ (์ƒ๋Œ€์ ์œผ๋กœ) ๊ตฌํ•˜๊ธฐ ์‰ฝ๊ณ  ์ „ ์ฒ˜๋ฆฌ
๊ณผ์ •์ด (์ƒ๋Œ€์ ์œผ๋กœ) ์ ๊ฒŒ ์š”๊ตฌ๋˜๋Š” ์ฃผ๊ฐ€ ์˜ˆ์ธก ๊ธฐ๋ณธ
๋ฐ์ดํ„ฐ๋ฅผ ํ™œ์šฉํ•˜์—ฌ ๊ฐ„๋‹จํ•œ ์‹ค์Šต์„ ํ•ด๋ณด์ž!
48
Deep Dive into Deep Learning : Exploration of CNN & RNN
โ€œ์ˆœ์ฐจโ€๋ผ๊ณ  ํ–ˆ๋Š”๋ฐโ€ฆ
๊ทธ๋Ÿฌ๋ฉด ๋ฐ์ดํ„ฐ๋ฅผ ์ž…๋ ฅํ•˜๊ธฐ ์œ„ํ•ด์„œ ์–ด๋–ค ๊ณผ์ •์ด
ํ•„์š”ํ• ๊นŒ?
โ€ข Sequence ๊ธธ์ด
(์—ฐ์†์  ์‚ฌ๊ฑด์˜ ์ˆ˜)
๏ƒ  ์–ด๋–ค ํ•œ ์‹œ์ ์„
์˜ˆ์ธกํ•˜๋Š”๋ฐ ๊ณผ๊ฑฐ ๋ช‡ ๊ฐœ์˜
์‹œ์ ์˜ ์‚ฌ๊ฑด์ด ์˜ํ–ฅ์„
๋ผ์ณค๋Š”๊ฐ€?
โ€ข ๋…๋ฆฝ๋ณ€์ˆ˜์™€ ์ข…์†๋ณ€์ˆ˜์˜
์ˆœ์ฐจ์  ์ž…๋ ฅ
๏ƒ  ๊ณผ๊ฑฐ Sequence ๊ธธ์ด
๋งŒํผ ํ•œ ์‹œ์  ์”ฉ ์ด๋™
ํ•ด๊ฐ€๋ฉด์„œ ์ž…๋ ฅ
1. Normalization 2. Sequence 3. Rolling Window
MinMax ์ •๊ทœํ™”
0 <
๐‘‹ โˆ’ ๐‘€๐‘–๐‘›(๐‘‹)
๐‘€๐‘Ž๐‘ฅ ๐‘‹ โˆ’ ๐‘€๐‘–๐‘›(๐‘‹)
< 1
49
Deep Dive into Deep Learning : Exploration of CNN & RNN
๋ณ€์ˆ˜์˜ ๋‹จ์œ„๊ฐ€ ๋‹ฌ๋ผ์„œ ๋ณ€์ˆ˜
๊ฐ„ ํฌ๊ธฐ ์ฐจ์ด๊ฐ€ ํฌ๋ฉฐ, ์ด๋Š”
์ •ํ™•ํ•œ Parameter ์ถ”์ •์ด
์•ˆ๋œ๋‹ค.
MinMax ์ •๊ทœํ™”
0 <
๐‘‹ โˆ’ ๐‘€๐‘–๐‘›(๐‘‹)
๐‘€๐‘Ž๐‘ฅ ๐‘‹ โˆ’ ๐‘€๐‘–๐‘›(๐‘‹)
< 1
1. Normalization
์ฃผ์‹๊ฐ€๊ฒฉ
(US Dollar, $)
๊ฑด
์ˆ˜
50
Deep Dive into Deep Learning : Exploration of CNN & RNN
2. Sequence
๋ช‡ ์ผ ์ „๊นŒ์ง€์˜ ์ฃผ์‹
๊ฐ€๊ฒฉ์ด ๋‹ค์Œ ๋‚  ์ฃผ์‹
๊ฐ€๊ฒฉ์— ์˜ํ–ฅ์„ ๋ฏธ์น ๊นŒ?
๋”ฐ๋ผ์„œ Sequence๋Š” 5!
5์ผ!
์ •ํ™•ํ•˜๊ฒŒ ์•Œ ์ˆ˜๋Š” ์—†์ง€๋งŒ,
์ฃผ๋ง์—๋Š” ์žฅ์ด ์•ˆ ์—ด๋ฆฌ๋‹ˆ
์ด๋ฅผ ๊ณ ๋ คํ•ด 1์ฃผ์ผ ์น˜๋ฅผ
๋ณด๊ณ  ๋‹ค์Œ ๋‚  ์ข…๊ฐ€๋ฅผ
์˜ˆ์ธกํ•ด ๋ณด์ž!
51
Deep Dive into Deep Learning : Exploration of CNN & RNN
3. Rolling Window
Rolling Window๋Š” ๋˜ ๋ญ”๊ฐ€โ€ฆ?
์šฉ์–ด์— ์ซ„์ง€ ๋ง์ž!!!
Sequence์˜ ๊ธธ์ด์ธ 5์ผ์น˜
๋ฐ์ดํ„ฐ์— ๋งž์ถ”์–ด์„œ ๋…๋ฆฝ๋ณ€์ˆ˜
X์™€ ์ข…์†๋ณ€์ˆ˜ Y๋ฅผ ์ˆœ์ฐจ์ ์œผ๋กœ
์„ค์ •ํ•˜๋Š” ๊ฒƒ์„ ๋งํ•œ๋‹ค!
๐‘‹ 1 = ๐‘‹1, ๐‘‹2 , ๐‘‹3, ๐‘‹4, ๐‘‹5 ๐‘Œ 1 = ๐‘Œ6
52
Deep Dive into Deep Learning : Exploration of CNN & RNN
3. Rolling Window
Rolling Window๋Š” ๋˜ ๋ญ”๊ฐ€โ€ฆ?
์šฉ์–ด์— ์ซ„์ง€ ๋ง์ž!!!
Sequence์˜ ๊ธธ์ด์ธ 5์ผ์น˜
๋ฐ์ดํ„ฐ์— ๋งž์ถ”์–ด์„œ ๋…๋ฆฝ๋ณ€์ˆ˜
X์™€ ์ข…์†๋ณ€์ˆ˜ Y๋ฅผ ์ˆœ์ฐจ์ ์œผ๋กœ
์„ค์ •ํ•˜๋Š” ๊ฒƒ์„ ๋งํ•œ๋‹ค!
๐‘‹ 1 = ๐‘‹1, ๐‘‹2 , ๐‘‹3, ๐‘‹4, ๐‘‹5
๐‘‹ 2 = ๐‘‹2, ๐‘‹3 , ๐‘‹4, ๐‘‹5, ๐‘‹6 ๐‘Œ 2 = ๐‘Œ7
๐‘Œ 1 = ๐‘Œ6
53
Deep Dive into Deep Learning : Exploration of CNN & RNN
3. Rolling Window
Rolling Window๋Š” ๋˜ ๋ญ”๊ฐ€โ€ฆ?
์šฉ์–ด์— ์ซ„์ง€ ๋ง์ž!!!
Sequence์˜ ๊ธธ์ด์ธ 5์ผ์น˜
๋ฐ์ดํ„ฐ์— ๋งž์ถ”์–ด์„œ ๋…๋ฆฝ๋ณ€์ˆ˜
X์™€ ์ข…์†๋ณ€์ˆ˜ Y๋ฅผ ์ˆœ์ฐจ์ ์œผ๋กœ
์„ค์ •ํ•˜๋Š” ๊ฒƒ์„ ๋งํ•œ๋‹ค!
๐‘‹ 1 = ๐‘‹1, ๐‘‹2 , ๐‘‹3, ๐‘‹4, ๐‘‹5
๐‘‹ 2 = ๐‘‹2, ๐‘‹3 , ๐‘‹4, ๐‘‹5, ๐‘‹6
๐‘‹ 3 = ๐‘‹3, ๐‘‹4 , ๐‘‹5, ๐‘‹6, ๐‘‹7
๐‘Œ 2 = ๐‘Œ7
๐‘Œ 3 = ๐‘Œ8
๐‘Œ 1 = ๐‘Œ6
54
Deep Dive into Deep Learning : Exploration of CNN & RNN
์ง€๊ธˆ๊นŒ์ง€ ์„ค๋ช…ํ•œ
๋ฐ์ดํ„ฐ ์ „ ์ฒ˜๋ฆฌ ์ฝ”๋“œ๋ฅผ
์‚ดํŽด๋ณด์ž!
55
Deep Dive into Deep Learning : Exploration of CNN & RNN
โ€ข Sequence ๊ธธ์ด
(์—ฐ์†์  ์‚ฌ๊ฑด์˜ ์ˆ˜)
๏ƒ  ์–ด๋–ค ํ•œ ์‹œ์ ์„
์˜ˆ์ธกํ•˜๋Š”๋ฐ ๊ณผ๊ฑฐ ๋ช‡ ๊ฐœ์˜
์‹œ์ ์˜ ์‚ฌ๊ฑด์ด ์˜ํ–ฅ์„
๋ผ์ณค๋Š”๊ฐ€?
โ€ข ๋…๋ฆฝ๋ณ€์ˆ˜์™€ ์ข…์†๋ณ€์ˆ˜์˜
์ˆœ์ฐจ์  ์ž…๋ ฅ
๏ƒ  ๊ณผ๊ฑฐ Sequence ๊ธธ์ด
๋งŒํผ ํ•œ ์‹œ์  ์”ฉ ์ด๋™
ํ•ด๊ฐ€๋ฉด์„œ ์ž…๋ ฅ
1. Normalization 2. Sequence 3. Rolling Window
MinMax ์ •๊ทœํ™”
0 <
๐‘‹ โˆ’ ๐‘€๐‘–๐‘›(๐‘‹)
๐‘€๐‘Ž๐‘ฅ ๐‘‹ โˆ’ ๐‘€๐‘–๐‘›(๐‘‹)
< 1
56
Deep Dive into Deep Learning : Exploration of CNN & RNN
โ€ข Sequence ๊ธธ์ด
(์—ฐ์†์  ์‚ฌ๊ฑด์˜ ์ˆ˜)
๏ƒ  ์–ด๋–ค ํ•œ ์‹œ์ ์„
์˜ˆ์ธกํ•˜๋Š”๋ฐ ๊ณผ๊ฑฐ ๋ช‡ ๊ฐœ์˜
์‹œ์ ์˜ ์‚ฌ๊ฑด์ด ์˜ํ–ฅ์„
๋ผ์ณค๋Š”๊ฐ€?
โ€ข ๋…๋ฆฝ๋ณ€์ˆ˜์™€ ์ข…์†๋ณ€์ˆ˜์˜
์ˆœ์ฐจ์  ์ž…๋ ฅ
๏ƒ  ๊ณผ๊ฑฐ Sequence ๊ธธ์ด
๋งŒํผ ํ•œ ์‹œ์  ์”ฉ ์ด๋™
ํ•ด๊ฐ€๋ฉด์„œ ์ž…๋ ฅ
1. Normalization 2. Sequence 3. Rolling Window
MinMax ์ •๊ทœํ™”
0 <
๐‘‹ โˆ’ ๐‘€๐‘–๐‘›(๐‘‹)
๐‘€๐‘Ž๐‘ฅ ๐‘‹ โˆ’ ๐‘€๐‘–๐‘›(๐‘‹)
< 1
๋”ฐ๋ผ์„œ Sequence๋Š” 5!
1์ฃผ์ผ ๋™์•ˆ์˜ Working Days๊ฐ€
๋‹ค์Œ ์‹œ์ ์˜ ์ข…๊ฐ€์— ์˜ํ–ฅ์„
๋ฏธ์นœ๋‹ค๊ณ  ๊ฐ€์ •
57
Deep Dive into Deep Learning : Exploration of CNN & RNN
โ€ข Sequence ๊ธธ์ด
(์—ฐ์†์  ์‚ฌ๊ฑด์˜ ์ˆ˜)
๏ƒ  ์–ด๋–ค ํ•œ ์‹œ์ ์„
์˜ˆ์ธกํ•˜๋Š”๋ฐ ๊ณผ๊ฑฐ ๋ช‡ ๊ฐœ์˜
์‹œ์ ์˜ ์‚ฌ๊ฑด์ด ์˜ํ–ฅ์„
๋ผ์ณค๋Š”๊ฐ€?
โ€ข ๋…๋ฆฝ๋ณ€์ˆ˜์™€ ์ข…์†๋ณ€์ˆ˜์˜
์ˆœ์ฐจ์  ์ž…๋ ฅ
๏ƒ  ๊ณผ๊ฑฐ Sequence ๊ธธ์ด
๋งŒํผ ํ•œ ์‹œ์  ์”ฉ ์ด๋™
ํ•ด๊ฐ€๋ฉด์„œ ์ž…๋ ฅ
1. Normalization 2. Sequence 3. Rolling Window
MinMax ์ •๊ทœํ™”
0 <
๐‘‹ โˆ’ ๐‘€๐‘–๐‘›(๐‘‹)
๐‘€๐‘Ž๐‘ฅ ๐‘‹ โˆ’ ๐‘€๐‘–๐‘›(๐‘‹)
< 1
58
Deep Dive into Deep Learning : Exploration of CNN & RNN
Data Setting์ด ๋๋‚˜๋ฉด Tensorflow๋ฅผ ํ™œ์šฉํ•˜์—ฌ
1๊ฐœ ์ธต์˜ LSTM ๋ชจ๋ธ ๊ทธ๋ž˜ํ”„๋ฅผ ๊ตฌ์ถ•ํ•ด ๋ณด์ž.
๋จผ์ € Hidden Layer์ธ Cell์„ ๋งŒ๋“œ๋Š”๋ฐ, ์œ„์™€ ๊ฐ™์ด
์ฝ”๋“œ ํ•œ ์ค„๋กœ ๋๋‚œ๋‹ค. ๋ณต์žกํ•œ ์ด๋ก ์ด ๋ฌด์ƒ‰ํ•˜๊ฒŒ
๊ต‰.์žฅ.ํžˆ. ์‹ฌ.ํ”Œ.ํ•˜๋‹ค.
59
Deep Dive into Deep Learning : Exploration of CNN & RNN
๊ทธ๋Ÿฐ๋ฐ ์ด dynamic_rnn์ด๋ผ๋Š” ๊ฒƒ์€ ๋ญ˜๊นŒ?
1๊ฐœ์˜ Cell์„ ๊ตฌ์ถ•ํ•œ ํ›„, y๊ฐ’๋“ค์„ ์‚ฐ์ถœํ•˜๋„๋ก rnn
Tensorflow ์ฝ”๋“œ์— ๋„ฃ๋Š”๋‹ค.
60
Deep Dive into Deep Learning : Exploration of CNN & RNN
๋งŒ์•ฝ ์˜์–ด๋ฅผ ํ•œ๊ตญ์–ด๋กœ ๋ฒˆ์—ญํ•˜๋Š” RNN๋ชจ๋ธ์„ ๊ตฌ์ถ•ํ•œ๋‹ค๊ณ  ํ•˜๋ฉด,
์ž…๋ ฅ๋˜๋Š” ๋‹จ์–ด์˜ ๊ธธ์ด ๋ฐ ๊ฐœ์ˆ˜๊ฐ€ ๋‹ค๋ฅด๊ธฐ ๋•Œ๋ฌธ์— ์ผ์ •ํ•œ ๊ธธ์ด์˜
sequence๋กœ Input์ด ๋“ค์–ด์˜ค์ง€ ์•Š๋Š”๋‹ค.
์˜ˆ๋ฅผ ๋“ค์–ด,
Show me the money. (sequence 4)
He is handsome. (sequence 3)
์„ ๋ฒˆ์—ญํ•œ๋‹ค๊ณ  ํ•˜๋ฉด, ์„œ๋กœ ๋‹ค๋ฅธ Sequence๋ฅผ ์ฒ˜๋ฆฌํ•ด์•ผ ํ•˜๊ธฐ ๋•Œ๋ฌธ์—
์ž…๋ ฅ ๊ฐ’์˜ ๊ธธ์ด์™€ ์ถœ๋ ฅ ๊ฐ’์˜ ๊ธธ์ด๊ฐ€ ์œ ๋™์ ์ด์–ด์•ผ ํ•œ๋‹ค.
๊ทธ๋ฆฌ๊ณ  ์ด๋ฅผ ๊ฐ€๋Šฅํ•˜๊ฒŒ ํ•˜๋Š” ๊ฒƒ์ด dynamic RNN์ด๋‹ค!
61
Deep Dive into Deep Learning : Exploration of CNN & RNN
์ดํ•ด๋ฅผ ๋•๊ธฐ ์œ„ํ•ด RNN ๊ทธ๋ž˜ํ”„๋กœ
์‚ดํŽด๋ณด๋ฉดโ€ฆ
62
Deep Dive into Deep Learning : Exploration of CNN & RNN
A
๐‘ฟ ๐’•
๐’‰ ๐’•
๐‘ฟ ๐ŸŽ
๐’‰ ๐ŸŽ
A
๐‘ฟ ๐Ÿ
๐’‰ ๐Ÿ
A
๐‘ฟ ๐Ÿ
๐’‰ ๐Ÿ
A
๐‘ฟ ๐’•
๐’‰ ๐’•
A
โ€ฆ
=
๋ฒˆ์—ญ์˜ ๊ฒฝ์šฐ outputs์œผ๋กœ ์ถœ๋ ฅ๋˜๋Š” ๋ชจ๋“  ์‚ฐ์ถœ ๊ฐ’์„ ์‚ฌ์šฉ
์ฃผ๊ฐ€ ์˜ˆ์ธก์€ โ€œ์ข…๊ฐ€โ€์—๋งŒ ๊ด€์‹ฌ์ด ์žˆ์œผ๋ฏ€๋กœ ๐’‰ ๐’•๋งŒ ์‚ฌ์šฉ
๊ด€์‹ฌ์‚ฌํ•ญ โ€œ์ข…๊ฐ€โ€ โ„Ž ๐‘ก๊ฐ’๋งŒ ์ถ”์ถœํ•˜๊ธฐ
์œ„ํ•ด tf.transpose ํ•จ์ˆ˜ ์‚ฌ์šฉ
63
Deep Dive into Deep Learning : Exploration of CNN & RNN
๊ฒฐ๊ณผ
64
Deep Dive into Deep Learning : Exploration of CNN & RNN
End of Document
Thank You for Listening
65
Deep Dive into Deep Learning : Exploration of CNN & RNN
์ฐธ๊ณ ๋ฌธํ—Œ
http://aikorea.org/blog/rnn-tutorial-3/
https://laonple.blog.me/
https://ratsgo.github.io/
https://m.blog.naver.com/PostView.nhn?blogId=infoefficien&logNo=221210061511&tar
getKeyword=&targetRecommendationCode=1https://github.com/hunkim/DeepLearning
ZeroToAll
๋งํฌ
Ba, J. L., Kiros, J. R., & Hinton, G. E. (2016). Layer normalization. arXiv preprint
arXiv:1607.06450.
Long, J., Shelhamer, E., & Darrell, T. (2015). Fully convolutional networks for semantic
segmentation. In Proceedings of the IEEE conference on computer vision and pattern
recognition (pp. 3431-3440).
Courville, A. (2016). Recurrent Batch Normalization. arXiv preprint arXiv:1603.09025.
Simonyan, K., & Zisserman, A. (2014). Very deep convolutional networks for large-scale
image recognition. arXiv preprint arXiv:1409.1556.
๋…ผ๋ฌธ

Final project v0.84

  • 1.
    Personal Project 2018๋…„ 03์›”09์ผ ์ „์„์›, ๊น€์ง€ํ—Œ, ๊น€ํ˜•์„ญ Final Portfolio Deep Dive into Deep Learning : Exploration of CNN & RNN
  • 2.
    2 Deep Dive intoDeep Learning : Exploration of CNN & RNN ๋ชฉ์ฐจ โ–  Summary โ–  CNN โ€“ Animal Classification (Cat vs. Dog) โ–  CNN โ€“ Leaf Classification (Healthy vs. Diseased) โ–  RNN โ€“ Stock Price Prediction
  • 3.
    3 Deep Dive intoDeep Learning : Exploration of CNN & RNN CNN/RNN ์ด๋ก ๊ณผ ์‹ค์Šต์˜ ๊ท ํ˜• ์žˆ๋Š” ํ•™์Šต์„ ์œ„ํ•ด CAT/DOG ์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜, ์ฃผ๊ฐ€ ์˜ˆ์ธก์„ ํ•˜๊ณ , CNN ์‘์šฉ์œผ๋กœ ์ดํŒŒ๋ฆฌ ์ด๋ฏธ์ง€๋ฅผ ๋ถ„๋ฅ˜ํ•จ Summary CNN Application RNN PracticeCNN Basic Practice II Leaf ClassificationAnimal Classification Stock Price Prediction ์ •ํ™•๋„ : 98.8%์ •ํ™•๋„ : 97.8% โ€ข Conv. Layer with Max Pool 4๊ฐœ โ€ข Batch Norm applied โ€ข Dropout : 0.5 โ€ข LR : 0.001 โ€ข Optimizer : Adam โ€ข Batch Size : 100 โ€ข Conv. Layer with Max Pool 4๊ฐœ โ€ข Batch Norm applied โ€ข Dropout : 0.5 โ€ข LR : 0.001 โ€ข Optimizer : Adam โ€ข Batch Size : 100 โ€ข LSTM with softsign โ€ข Minmax scaling โ€ข Dropout : 0.5 โ€ข LR : 0.001 โ€ข Optimizer : Adam โ€ข Batch Size : 100 CNN Basic Practice I
  • 4.
    4 Deep Dive intoDeep Learning : Exploration of CNN & RNN ๋ชฉ์ฐจ โ–  Summary โ–  CNN โ€“ Animal Classification (Cat vs. Dog) โ–  CNN โ€“ Leaf Classification (Healthy vs. Diseased) โ–  RNN โ€“ Stock Price Prediction
  • 5.
    5 Deep Dive intoDeep Learning : Exploration of CNN & RNN ๊ธฐ.๋ณธ.์— ์ถฉ์‹คํ•˜์ž! ๊ธฐ.๋ณธ.์„ ๊ฐˆ๊ณ  ๋‹ฆ์ž! ๊ธฐ.๋ณธ.์ด ์ฐจ์ด๋ฅผ ๋งŒ๋“ ๋‹ค! CNN์˜ ํ•„.์ˆ˜. ์ž….๋ฌธ.์ด๋ผ๊ณ  ํ•  ์ˆ˜ ์žˆ๋Š” โ€œ๊ฐœ/๊ณ ์–‘์ด ๋ถ„๋ฅ˜โ€๋ฅผ ํ•ด๋ณผ๊นŒ?
  • 6.
    6 Deep Dive intoDeep Learning : Exploration of CNN & RNN ๋„Œ ๋ˆ„๊ตฌ๋ƒโ€ฆ? ๊ฐœ? ๊ณ ์–‘์ด? ๊ฐœ๋ƒฅ์ด!!!
  • 7.
    7 Deep Dive intoDeep Learning : Exploration of CNN & RNN ๊ฐœ/๊ณ ์–‘์ด ๋ถ„๋ฅ˜๋ฅผ ์œ„ํ•œ ๋ชจ๋ธ์€ ํฌ๊ฒŒ 4๊ฐœ์˜ Conv Layer์™€ 1๊ฐœ์˜ Convolutional & FC Layer๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ๋‹ค. Structure Overview Convolution Batch Normalization Rectified LinearUnit MaxPooling Convolution Batch Normalization Rectified LinearUnit MaxPooling Convolution Batch Normalization Rectified LinearUnit MaxPooling Convolution Batch Normalization Rectified LinearUnit MaxPooling Convolution Convolution Fully Connected Data Conv. 1 Conv. 2 Conv. 3Conv. 4Conv & FC Drop Out : 0.5 Drop Out : 0.5 Drop Out : 0.5Drop Out : 0.5 Optimizer : Adam Learning Rate: 0.001 Batch Size : 100
  • 8.
    8 Deep Dive intoDeep Learning : Exploration of CNN & RNN Convolutional Layer1์˜ Graphical Description์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค. 10x10, S: 1, 20 Filters Convolutional Layer 1 Convolution Batch Normalization Rectified LinearUnit MaxPooling Batch Norm & ReLU (Max Pool) 3x3, S: 2, P: SAME
  • 9.
    9 Deep Dive intoDeep Learning : Exploration of CNN & RNN 10x10, S: 1, 40 Filters Convolutional Layer 2 Convolution Batch Normalization Rectified LinearUnit MaxPooling Batch Norm & ReLU (Max Pool) 3x3, S: 2, P: SAME Previous Layer Convolutional Layer2์˜ Graphical Description์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
  • 10.
    10 Deep Dive intoDeep Learning : Exploration of CNN & RNN 7x7, S: 1, 60 Filters Convolutional Layer 3 Convolution Batch Normalization Rectified LinearUnit MaxPooling 32 x 32 x 60 (Max Pool) 3x3, S: 2, P: SAME 32 x 32 x 40 Previous Layer 32 x 32 x 60 16 x 16 x 60 Convolutional Layer3์˜ Graphical Description์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
  • 11.
    11 Deep Dive intoDeep Learning : Exploration of CNN & RNN Convolutional Layer 4 Convolution Batch Normalization Rectified LinearUnit MaxPooling 16 x 16 x 60 16 x 16 x 80 5x5, S: 1, 80 Filters Previous Layer 16 x 16 x 80 Batch Norm & ReLU 8 x 8 x 80 (Max Pool) 3x3, S: 2, P: SAME Convolutional Layer4์˜ Graphical Description์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
  • 12.
    12 Deep Dive intoDeep Learning : Exploration of CNN & RNN Convolutional & Fully Connected Layer Fully Connected Convolution Convolution Previous Layer 0.3 โ‹ฎ 0.5 (FC) (8*8*100)x 200 8 x 8 x 80 PreviousLayer 8 x 8 x 100 3x3, S: 1, 100 Filters 8 x 8 x 100 (FC) (8*8*100)x200 3x3, S: 1, 100 Filters 1 0 (FC) (8*8*100)x 200 (FC) 200x2 200x1 2x1 Conv & FC Layer์˜ Graphical Description์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
  • 13.
    13 Deep Dive intoDeep Learning : Exploration of CNN & RNN ๋ถ„์„ ๊ฒฐ๊ณผ ์ •ํ™•๋„ : 97.83%
  • 14.
    14 Deep Dive intoDeep Learning : Exploration of CNN & RNN ๋ชฉ์ฐจ โ–  Summary โ–  CNN โ€“ Animal Classification (Cat vs. Dog) โ–  CNN โ€“ Leaf Classification (Healthy vs. Diseased) โ–  RNN โ€“ Stock Price Prediction
  • 15.
    15 Deep Dive intoDeep Learning : Exploration of CNN & RNN CIFAR10๊ณผ ๊ฐœ๋ƒฅ์ด ๋ถ„๋ฅ˜๋ฅผ ํ•ด๋ณด๋‹ˆ ์ด์ œ CNN์— ์ข€ ์ต์ˆ™ํ•ด์ง„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. (๋ฟŒ๋“ฏ๋ฟŒ๋“ฏ^^) ์ด์ œ๋Š” ์ง€๊ธˆ๊ป ๊ฐˆ๊ณ  ๋‹ฆ์€ ๊ธฐ์ˆ ์„ ํ™œ์šฉํ•ด ๋ณผ ๋‹จ๊ณ„!
  • 16.
    16 Deep Dive intoDeep Learning : Exploration of CNN & RNN ๋ญ˜ ํ• ๊นŒ? (๊ณ ๋ฏผ๊ณ ๋ฏผ) โ€ฆ โ€ฆ IDEA IDEA IDEA IDEA IDEA
  • 17.
    17 Deep Dive intoDeep Learning : Exploration of CNN & RNN (1) ์ œํ•œ๋œ ์‹œ๊ฐ„ ๋‚ด์— ํ•  ์ˆ˜ ์žˆ๋Š”, (2) ๋‚˜์˜ ์ด๋ ฅ์— ๋„์›€์ด ๋˜๋Š”, (3) ์žฌ๋ฏธ์žˆ๋Š” ์ฃผ์ œ๊ฐ€ ๋ญ๊ฐ€ ์žˆ์„๊นŒโ€ฆ?! ์š”์ฆ˜ ์ œ์กฐ์—…์—์„œ ๊ณต์žฅ์ž๋™ํ™”๋ฅผ ๋„˜์–ด Smart Factory ์‚ฌ์—…์„ ์ถ”์ง„ํ•œ๋‹ค๋Š”๋ฐโ€ฆ!
  • 18.
    18 Deep Dive intoDeep Learning : Exploration of CNN & RNN Smart Factory์˜ CNN ํ™œ์šฉ์€?! ์ œํ’ˆ ๋ถˆ๋Ÿ‰ํ’ˆ ๊ฒ€์ถœ! ๊ฐ€์ž!!! ๊ฐ€์ž!! ๊ฐ€์ž! : ๋ฐ์ดํ„ฐ๊ฐ€ ์—†๋‹คโ€ฆ!
  • 19.
    19 Deep Dive intoDeep Learning : Exploration of CNN & RNN ๊ณต์žฅ ์ œํ’ˆ ๋ฐ์ดํ„ฐ๊ฐ€ ์—†์œผ๋ฉด, ๊ทธ ๋Œ€์•ˆ์œผ๋กœ โ€œ์•„ํ”ˆ ์ดํŒŒ๋ฆฌ vs. ๊ฑด๊ฐ•ํ•œ ์ดํŒŒ๋ฆฌโ€ ๋ฅผ ๋ถ„๋ฅ˜ํ•ด ๋ณด๋Š” ๊ฒƒ๋„ ์ข‹์„ ๊บผ์•ผ! ๋น„์Šทํ•˜์ž–์•„? ITWILL ๋”ฅ๋Ÿฌ๋‹ ์ „์ž„๊ฐ•์‚ฌ ์Šค๋งˆํŠธํŒฉํ† ๋ฆฌ ๋ถ„์•ผ ๋”ฅ๋Ÿฌ๋‹ ์ „๋ฌธ ์—ฐ๊ตฌ์› ๋งž์Šต๋‹ˆ๋‹ค! ๊ทธ๋ ‡์Šต๋‹ˆ๋‹ค!! ์ข‹์•„! ๊ทธ๋Ÿผ ์•„ํ”ˆ ์ดํŒŒ๋ฆฌ๋ฅผ ๋ชจ์กฐ๋ฆฌ ๊ฒ€์ถœํ•ด ๋ด…์‹œ๋‹ค! ํ˜น ์ด ๊ธ€์„ ์ฝ์œผ์‹œ๋Š” ๋”ฅ๋Ÿฌ๋‹ ์ „๋ฌธ๊ฐ€ ๋ถ„๋“ค๊ป˜. ์šฐ๋ฆฌ๋‚˜๋ผ์˜ ๋”ฅ๋Ÿฌ๋‹ ๊ต์œก์„ ์œ„ํ•ด ๊ต์œก์šฉ ๋ฐ์ดํ„ฐ ์ข€ ๊ณต๊ฐœํ•ด ์ฃผ์„ธ์š”! ์–ธ์ œ๊นŒ์ง€ ๋ฏธ๊ตญ ๋ฐ์ดํ„ฐ ์จ์•ผ ํ•˜๋‚˜์š”โ€ฆใ… ใ…  ๊ต์œก์ด ํž˜์ž…๋‹ˆ๋‹ค!
  • 20.
    20 Deep Dive intoDeep Learning : Exploration of CNN & RNN Structure Overview Convolution Batch Normalization Rectified LinearUnit MaxPooling Convolution Batch Normalization Rectified LinearUnit MaxPooling Convolution Batch Normalization Rectified LinearUnit MaxPooling Convolution Batch Normalization Rectified LinearUnit MaxPooling Data Conv. 1 Conv. 2 Conv. 3Conv. 4Conv & FC Drop Out : 0.5 Drop Out : 0.5 Drop Out : 0.5Drop Out : 0.5 Batch Size : 100 Fully Connected Convolution MaxPooling Convolution Optimizer : Adam Learning Rate: 0.001 ๋ณ‘๋“  ์ดํŒŒ๋ฆฌ๋ฅผ ์ฐพ๊ธฐ ์œ„ํ•œ ๋ชจ๋ธ์€ 4๊ฐœ์˜ Conv. Layer์™€ 1๊ฐœ์˜ Conv+FC ์กฐํ•ฉ Layer๋กœ ๊ตฌ์„ฑ๋œ๋‹ค.
  • 21.
    21 Deep Dive intoDeep Learning : Exploration of CNN & RNN 10x10, S: 1, 20 Filters Convolutional Layer 1 Convolution Batch Normalization Rectified LinearUnit MaxPooling Batch Norm & ReLU (Max Pool) 3x3, S: 2, P: SAME Original Image Re-coloring Background Pre-Processing Data ํšจ๊ณผ์ ์ด๊ณ  ํšจ์œจ์ ์ธ ๋ถ„์„์„ ์œ„ํ•ด ๋ชจ๋“  ์ด๋ฏธ์ง€์˜ ๋ฐฐ๊ฒฝ์ƒ‰์„ ๊ฒ€์ •์ƒ‰์œผ๋กœ ํ†ต์ผํ•จ Conv 1์ธต์˜ Graphical Description์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
  • 22.
    22 Deep Dive intoDeep Learning : Exploration of CNN & RNN 10x10, S: 1, 40 Filters Convolutional Layer 2 Convolution Batch Normalization Rectified LinearUnit MaxPooling Batch Norm & ReLU (Max Pool) 3x3, S: 2, P: SAME Previous Layer Conv 2์ธต์˜ Graphical Description์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
  • 23.
    23 Deep Dive intoDeep Learning : Exploration of CNN & RNN 10x10, S: 1, 60 Filters Convolutional Layer 3 Convolution Batch Normalization Rectified LinearUnit MaxPooling 64 x 64 x 60 (Max Pool) 3x3, S: 2, P: SAME 64 x 64 x 40 Previous Layer 64 x 64 x 60 32 x 32 x 60 Conv 3์ธต์˜ Graphical Description์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
  • 24.
    24 Deep Dive intoDeep Learning : Exploration of CNN & RNN Convolutional Layer 4 Convolution Batch Normalization Rectified LinearUnit MaxPooling 32 x 32 x 60 32 x 32 x 80 10x10, S: 1, 80 Filters Previous Layer 32 x 32 x 80 Batch Norm & ReLU 16 x 16 x 80 (Max Pool) 3x3, S: 2, P: SAME Conv 4์ธต์˜ Graphical Description์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
  • 25.
    25 Deep Dive intoDeep Learning : Exploration of CNN & RNN Convolutional & Fully Connected Layer Previous Layer 16 x 16 x 80 PreviousLayer 16 x 16 x 100 8 x 8 x 100 (FC) (8*8*100)x200 10x10, S: 1, 100 Filters (FC) 200x2 200x1 2x1 Fully Connected Convolution MaxPooling Convolution 10x10, S: 1, 200 Filters (Max Pool) 3x3, S: 2, P: SAME 8 x 8 x 100 0.3 0.1 0.7 โ‹ฎ 0.9 โ‹ฎ 0.3 โ‹ฎ 0.2 0.6 0.5 0.8 0.3 (Conv+FC) ์ธต์˜ Graphical Description์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
  • 26.
    26 Deep Dive intoDeep Learning : Exploration of CNN & RNN ๋ถ„์„ ๊ฒฐ๊ณผ ์ •ํ™•๋„ : 98.80%
  • 27.
    27 Deep Dive intoDeep Learning : Exploration of CNN & RNN ๋ชฉ์ฐจ โ–  Summary โ–  CNN โ€“ Animal Classification (Cat vs. Dog) โ–  CNN โ€“ Leaf Classification (Healthy vs. Diseased) โ–  RNN โ€“ Stock Price Prediction
  • 28.
    28 Deep Dive intoDeep Learning : Exploration of CNN & RNN ์ด๋ฒˆ์—๋Š” ๋”ฅ๋Ÿฌ๋‹์˜ ๊ฝƒ ์ด๋ผ๋Š” RNN์„ ํ•œ ๋ฒˆ ํ•ด๋ณด์ž! ๊ทธ๋Ÿฐ๋ฐ RNN์ด ๋ญ์ง€?
  • 29.
    29 Deep Dive intoDeep Learning : Exploration of CNN & RNN Recurrent Neural Net ์ˆœํ™˜ ์‹ ๊ฒฝ๋ง (์ถœ์ฒ˜ : ๋„ค์ด๋ฒ„ ์–ดํ•™์‚ฌ์ „)
  • 30.
    30 Deep Dive intoDeep Learning : Exploration of CNN & RNN ์ด ์„ธ์ƒ์—” ์ด๋ฏธ์ง€์ฒ˜๋Ÿผ ๊ณ ์ •๋˜์–ด ์žˆ๋Š” ๊ฒƒ๋ณด๋‹ค ์‹œ๊ฐ„์ˆœ์„œ๋ฅผ ๊ฐ–๋Š” ๋ฐ์ดํ„ฐ๊ฐ€ ํ›จ~์”ฌ ๋งŽ๋‹ค ๋ฐ”๋กœ ์ด๋Ÿฐ ์ˆœ์„œ๋ฅผ ๊ฐ–๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ์ฒ˜๋ฆฌํ•˜๋Š” ์‹ ๊ฒฝ๋ง์ด RNN!
  • 31.
    31 Deep Dive intoDeep Learning : Exploration of CNN & RNN ์ด์ „์— ์ž…๋ ฅ ๋ฐ›์€ ๋ฐ์ดํ„ฐ์˜ ์ •๋ณด๋ฅผ ๋ฒ„๋ฆฌ์ง€ ์•Š๊ณ , ๊ทธ ๋‹ค์Œ์˜ ์ž…๋ ฅํ•  ๋ฐ์ดํ„ฐ์— ๋‹ค์‹œ ๋”ํ•ด์„œ ์—ฐ์‚ฐ์— ์‚ฌ์šฉํ•œ๋‹ค. ๊ทธ๋ž˜์„œ โ€œ์ˆœํ™˜!!โ€ ๋‹ค์‹œ ๋งํ•˜๋ฉด,
  • 32.
    32 Deep Dive intoDeep Learning : Exploration of CNN & RNN RNN์˜ Forward Propagation์„ ๋ณด์—ฌ์ฃผ๊ธฐ ์œ„ํ•ด ์ˆœํ™˜์„ ๋ฐ˜์˜ํ•œ CELL์„ ๋„์‹ํ™”ํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค. A ๐‘ฟ ๐’• ๐’‰ ๐’• ์—ฌ๊ธฐ์„œ CELL์ด๋ž€, ์ˆœํ™˜ ๊ฐœ๋…์„ ๋‚ดํฌํ•œ ํ•˜๋‚˜์˜ Hidden Layer๋ผ๊ณ  ์ƒ๊ฐํ•˜์ž.
  • 33.
    33 Deep Dive intoDeep Learning : Exploration of CNN & RNN ๋„์‹ํ™”๋œ CELL์ด ์•Œ ๋“ฏ ํ•˜๋ฉด์„œ ์ƒ์†Œํ•˜๋‹ค! ์ด๋ฅผ ํ’€์–ด์„œ ๊ทธ๋ ค๋ณด๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค. A ๐‘ฟ ๐’• ๐’‰ ๐’• ๐‘ฟ ๐ŸŽ ๐’‰ ๐ŸŽ A ๐‘ฟ ๐Ÿ ๐’‰ ๐Ÿ A ๐‘ฟ ๐Ÿ ๐’‰ ๐Ÿ A ๐‘ฟ ๐’• ๐’‰ ๐’• A โ€ฆ = ๊ทธ๋ฆฌ๊ณ  ํ’€์–ด์ง„ ๊ฐ ํ•˜๋‚˜ํ•˜๋‚˜๋ฅผ ํ•œ Sequence์ด๋‹ค. Cell Sequence
  • 34.
    34 Deep Dive intoDeep Learning : Exploration of CNN & RNN 2๊ฐœ์˜ Cell, ์ฆ‰ 2๊ฐœ์˜ Layer๋กœ ํ™•์žฅํ•œ ์ถœ๋ ฅ์ธต๊ณผ ์‚ฐ์ถœ์‹์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค. A ๐‘ฟ ๐’• ๐‘ฟ ๐ŸŽ A ๐‘ฟ ๐Ÿ A ๐‘ฟ ๐Ÿ A ๐‘ฟ ๐’• A โ€ฆ =A A A A A ๐’š ๐’• ๐’š ๐ŸŽ ๐’š ๐Ÿ ๐’š ๐Ÿ ๐’š ๐’• โ€ฆ ๐’‰ ๐’• = ๐’•๐’‚๐’๐’‰(๐‘พ ๐’‰๐’‰ ๐’‰ ๐’•โˆ’๐Ÿ + ๐‘พ ๐’™๐’‰ ๐’™ ๐’• + ๐’ƒ ๐’‰) ๐’š ๐’• = ๐‘พ ๐’‰๐’š ๐’‰ ๐’• + ๐’ƒ ๐’š
  • 35.
    35 Deep Dive intoDeep Learning : Exploration of CNN & RNN ๋‹ค์Œ 1๊ฐœ Cell์˜ Forward Propagation ์ˆ˜์‹์„ ๊ทธ๋ž˜ํ”„๋กœ ํ‘œํ˜„ํ•ด ๋ณด์ž. ( ์ถœ์ฒ˜: ratsgoโ€™s blog for textmining, https://ratsgo.github.io/natural%20language%20processing/2017/03/09/rnnlstm/ ) ๐’‰ ๐’• = ๐’•๐’‚๐’๐’‰(๐‘พ ๐’‰๐’‰ ๐’‰ ๐’•โˆ’๐Ÿ + ๐‘พ ๐’™๐’‰ ๐’™ ๐’• + ๐’ƒ ๐’‰) ๐’š ๐’• = ๐‘พ ๐’‰๐’š ๐’‰ ๐’• + ๐’ƒ ๐’š ๐‘ฅ ๐‘ก ๐‘Š๐‘ฅโ„Ž ๐‘Šโ„Žโ„Ž โ„Ž ๐‘กโˆ’1 ร— ร— + ๐‘โ„Ž ๐‘ก๐‘Ž๐‘›โ„Ž ๐‘Šโ„Ž๐‘ฆ ร— ๐‘ ๐‘ฆ + โ„Ž ๐‘ก ๐‘ฆ๐‘ก โ„Ž ๐‘ก ์ƒ๊ฐ๋ณด๋‹ค ๋ณต์žกํ•˜์ง€ ์•Š๋‹ค!
  • 36.
    36 Deep Dive intoDeep Learning : Exploration of CNN & RNN Forward Propagation์ด ์žˆ์œผ๋‹ˆ ๋‹น์—ฐํžˆ Backward Propagation๋„ ์žˆ์„ ๊ฒƒ์ด๋‹ค.
  • 37.
    37 Deep Dive intoDeep Learning : Exploration of CNN & RNN ๐’‰ ๐’• = ๐’•๐’‚๐’๐’‰(๐‘พ ๐’‰๐’‰ ๐’‰ ๐’•โˆ’๐Ÿ + ๐‘พ ๐’™๐’‰ ๐’™ ๐’• + ๐’ƒ ๐’‰) ๐’š ๐’• = ๐‘พ ๐’‰๐’š ๐’‰ ๐’• + ๐’ƒ ๐’š ๐‘ฅ ๐‘ก ๐‘Š๐‘ฅโ„Ž ๐‘Šโ„Žโ„Ž โ„Ž ๐‘กโˆ’1 ร— ร— + ๐‘โ„Ž ๐‘ก๐‘Ž๐‘›โ„Ž ๐‘Šโ„Ž๐‘ฆ ร— ๐‘ ๐‘ฆ + โ„Ž ๐‘Ÿ๐‘Ž๐‘ค ๐‘ฆ๐‘ก โ„Ž ๐‘ก ๐‘‘๐‘ฆ๐‘ก ๐‘‘๐‘ฆ๐‘ก ๐‘‘๐‘ฆ๐‘ก โ„Ž ๐‘ก ร— ๐‘‘๐‘ฆ๐‘ก โ„Ž ๐‘ก ๐‘Šโ„Ž๐‘ฆ ร— ๐‘‘๐‘ฆ๐‘ก (1 โˆ’ ๐‘ก๐‘Ž๐‘›โ„Ž2 โ„Ž ๐‘Ÿ๐‘Ž๐‘ค ) ร— ๐‘‘โ„Ž ๐‘ก ๐‘‘โ„Ž ๐‘Ÿ๐‘Ž๐‘ค ๐‘‘โ„Ž ๐‘Ÿ๐‘Ž๐‘ค ๐‘‘โ„Ž ๐‘Ÿ๐‘Ž๐‘ค ๐‘‘โ„Ž ๐‘Ÿ๐‘Ž๐‘ค ๐‘ฅ ๐‘ก ร— ๐‘‘โ„Ž ๐‘Ÿ๐‘Ž๐‘ค ๐‘Š๐‘ฅโ„Ž ร— ๐‘‘โ„Ž ๐‘Ÿ๐‘Ž๐‘ค โ„Ž ๐‘กโˆ’1 ร— ๐‘‘โ„Ž ๐‘Ÿ๐‘Ž๐‘ค ๐‘Šโ„Žโ„Ž ร— ๐‘‘โ„Ž ๐‘Ÿ๐‘Ž๐‘ค ( ์ถœ์ฒ˜: ratsgoโ€™s blog for textmining, https://ratsgo.github.io/natural%20language%20processing/2017/03/09/rnnlstm/ ) ์•„๋‹ˆ๋‹ค... ๋ณต์žกํ•˜๊ธด ํ•˜๋‹คโ€ฆ ์‹œ๊ฐ„์„ ๊ฑฐ์Šฌ๋Ÿฌ ๊ฐ€๋ฉด์„œ ์—ญ์ „ํŒŒ๋ฅผ ์ง„ํ–‰ํ•˜๋ฏ€๋กœ Back Propagation Through Time(BPTT) ๋ผ๊ณ  ๋ถ€๋ฅธ๋‹ค.
  • 38.
    38 Deep Dive intoDeep Learning : Exploration of CNN & RNN ๐’‰ ๐’• = ๐’•๐’‚๐’๐’‰(๐‘พ ๐’‰๐’‰ ๐’‰ ๐’•โˆ’๐Ÿ + ๐‘พ ๐’™๐’‰ ๐’™ ๐’• + ๐’ƒ ๐’‰) ๐’š ๐’• = ๐‘พ ๐’‰๐’š ๐’‰ ๐’• + ๐’ƒ ๐’š ๐‘ฅ ๐‘ก ๐‘Š๐‘ฅโ„Ž ๐‘Šโ„Žโ„Ž ร— ร— + ๐‘โ„Ž ๐‘ก๐‘Ž๐‘›โ„Ž ๐‘Šโ„Ž๐‘ฆ ร— ๐‘ ๐‘ฆ + โ„Ž ๐‘ก ๐‘Ÿ๐‘Ž๐‘ค ๐‘ฆ๐‘ก ๐’‰ ๐’• ๐‘‘๐‘ฆ๐‘ก ๐‘‘๐‘ฆ๐‘ก ๐‘‘๐‘ฆ๐‘ก โ„Ž ๐‘ก ร— ๐‘‘๐‘ฆ๐‘ก โ„Ž ๐‘ก ๐‘Šโ„Ž๐‘ฆ ร— ๐‘‘๐‘ฆ๐‘ก (1 โˆ’ ๐‘ก๐‘Ž๐‘›โ„Ž2 โ„Ž ๐‘ก ๐‘Ÿ๐‘Ž๐‘ค ) ร— ๐‘‘โ„Ž ๐‘ก ๐‘‘โ„Ž ๐‘ก ๐‘Ÿ๐‘Ž๐‘ค ๐‘‘โ„Ž ๐‘ก ๐‘Ÿ๐‘Ž๐‘ค ๐‘‘โ„Ž ๐‘ก ๐‘Ÿ๐‘Ž๐‘ค ๐‘‘โ„Ž ๐‘ก ๐‘Ÿ๐‘Ž๐‘ค ๐‘ฅ ๐‘ก ร— ๐‘‘โ„Ž ๐‘Ÿ๐‘Ž๐‘ค ๐‘ก ๐‘Š๐‘ฅโ„Ž ร— ๐‘‘โ„Ž ๐‘ก ๐‘Ÿ๐‘Ž๐‘ค โ„Ž ๐‘กโˆ’1 ร— ๐‘‘โ„Ž ๐‘ก ๐‘Ÿ๐‘Ž๐‘ค ๐‘Šโ„Žโ„Ž ร— ๐‘‘โ„Ž ๐‘ก ๐‘Ÿ๐‘Ž๐‘ค ( ์ถœ์ฒ˜: ratsgoโ€™s blog for textmining, https://ratsgo.github.io/natural%20language%20processing/2017/03/09/rnnlstm/ ) ํ•œ Cell์—์„œ ๋ฏธ๋ถ„ํ•˜๋Š” Parameter๊ฐ€ ๋ณ€ํ•˜์ง€ ์•Š์•„, ๊ตฌ์กฐ์ƒ ๊ฑฐ์Šฌ๋Ÿฌ ์˜ฌ๋ผ๊ฐ€๋ฉด์„œ ํ™œ์„ฑํ™”ํ•จ์ˆ˜๋ฅผ ์—ฌ๋Ÿฌ ๋ฒˆ ๋ฏธ๋ถ„ํ•˜๊ฒŒ ๋œ๋‹ค โ„Ž ๐‘กโˆ’1 โ€œ์ˆœํ™˜โ€ ๊ตฌ์กฐ์ด๋ฏ€๋กœ ๐’‰ ๐’• ์ฒ˜๋Ÿผ ๐’‰ ๐’•โˆ’๐Ÿ์ด ์ด ์ „ Sequence๋กœ Back Propagation ๋œ๋‹ค.
  • 39.
    39 Deep Dive intoDeep Learning : Exploration of CNN & RNN ๐’™ ๐’•โˆ’๐Ÿ ๐‘พ ๐’™๐’‰ ๐‘พ ๐’‰๐’‰ ๐’‰ ๐’•โˆ’๐Ÿ ร— ร— + ๐‘โ„Ž ๐‘ก๐‘Ž๐‘›โ„Ž ๐‘Šโ„Ž๐‘ฆ ร— ๐‘ ๐‘ฆ + โ„Ž ๐‘กโˆ’1 ๐‘Ÿ๐‘Ž๐‘ค ๐‘ฆ๐‘กโˆ’1 ๐’‰ ๐’•โˆ’๐Ÿ ๐‘‘๐‘ฆ๐‘กโˆ’1 ๐‘‘๐‘ฆ๐‘กโˆ’1 ๐‘‘๐‘ฆ๐‘กโˆ’1 โ„Ž ๐‘กโˆ’1 ร— ๐‘‘๐‘ฆ๐‘กโˆ’1 โ„Ž ๐‘กโˆ’1 ๐‘Šโ„Ž๐‘ฆ ร— ๐‘‘๐‘ฆ๐‘กโˆ’1 (1 โˆ’ ๐‘ก๐‘Ž๐‘›โ„Ž2 โ„Ž ๐‘กโˆ’1 ๐‘Ÿ๐‘Ž๐‘ค ) ร— ๐’…๐’‰ ๐’•โˆ’๐Ÿ ๐‘‘โ„Ž ๐‘กโˆ’1 ๐‘Ÿ๐‘Ž๐‘ค ๐‘‘โ„Ž ๐‘กโˆ’1 ๐‘Ÿ๐‘Ž๐‘ค ๐‘‘โ„Ž ๐‘กโˆ’1 ๐‘Ÿ๐‘Ž๐‘ค ๐‘‘โ„Ž ๐‘กโˆ’1 ๐‘Ÿ๐‘Ž๐‘ค ๐‘ฅ ๐‘กโˆ’1 ร— ๐‘‘โ„Ž ๐‘กโˆ’1 ๐‘Ÿ๐‘Ž๐‘ค ๐‘พ ๐’™๐’‰ ร— ๐’…๐’‰ ๐’•โˆ’๐Ÿ ๐’“๐’‚๐’˜ โ„Ž ๐‘กโˆ’2 ร— ๐‘‘โ„Ž ๐‘กโˆ’1 ๐‘Ÿ๐‘Ž๐‘ค ๐‘พ ๐’‰๐’‰ ร— ๐’…๐’‰ ๐’•โˆ’๐Ÿ ๐’“๐’‚๐’˜ ( ์ถœ์ฒ˜: ratsgoโ€™s blog for textmining, https://ratsgo.github.io/natural%20language%20processing/2017/03/09/rnnlstm/ ) (๐‘ก์‹œ์ ์œผ๋กœ ๋ถ€ํ„ฐ์˜ ์—ญ ์ „ํŒŒ ๊ฒฐ๊ณผ) ํ•œ Cell์—์„œ ๋ฏธ๋ถ„ํ•˜๋Š” Parameter๊ฐ€ ๋ณ€ํ•˜์ง€ ์•Š์•„, ๊ตฌ์กฐ์ƒ ๊ฑฐ์Šฌ๋Ÿฌ ์˜ฌ๋ผ๊ฐ€๋ฉด์„œ ํ™œ์„ฑํ™”ํ•จ์ˆ˜๋ฅผ ์—ฌ๋Ÿฌ ๋ฒˆ ๋ฏธ๋ถ„ํ•˜๊ฒŒ ๋œ๋‹ค ๐‘พ ๐’‰๐’š ร— ๐’…๐’š๐’•โˆ’๐Ÿ + ๐’…๐’‰ ๐’•โˆ’๐Ÿ ์•ž ์‹œ์ ์œผ๋กœ๋ถ€ํ„ฐ ์˜ค๋Š” ๐’‰๐’•โˆ’๐Ÿ์˜ ์—ญ์ „ํŒŒ ๊ฐ’๊ณผ Loss๋กœ๋ถ€ํ„ฐ ์˜ค๋Š” ๐’‰๐’•โˆ’๐Ÿ์˜ ์—ญ์ „ํŒŒ ๊ฐ’์„ ํ•ฉํ•œ๋‹ค.
  • 40.
    40 Deep Dive intoDeep Learning : Exploration of CNN & RNN A ๐‘ฟ ๐’• ๐’‰ ๐’•RNN์€ CNN๊ณผ ๋‹ฌ๋ฆฌ Activation Function์œผ๋กœ Hyperbolic Tangent๊ฐ€ ์ผ๋ฐ˜์ ์ด๋‹ค. ๐’‰ ๐’• = ๐’•๐’‚๐’๐’‰(๐‘พ ๐’‰๐’‰ ๐’‰๐’•โˆ’๐Ÿ + ๐‘พ ๐’™๐’‰ ๐’™ ๐’• + ๐’ƒ ๐’‰) ์•„? ์™œ์ฃ ???
  • 41.
    41 Deep Dive intoDeep Learning : Exploration of CNN & RNN 0 1 2 3 4 5 6 -6 -4 -2 0 2 4 6 Rectified Linear Unit ๐’‡ ๐’› = แ‰Š ๐ŸŽ, ๐’› โ‰ค ๐ŸŽ ๐’›, ๐’› > ๐ŸŽ -1.5 -1 -0.5 0 0.5 1 1.5 -6 -4 -2 0 2 4 6 Hyperbolic Tangent ๐’•๐’‚๐’๐’‰(๐’™) = ๐’† ๐’™ โˆ’ ๐’†โˆ’๐’™ ๐’† ๐’™ + ๐’†โˆ’๐’™ Forward Propagation ์—์„œ ์‚ฐ์ถœ๋  ์ˆ˜ ์žˆ๋Š” ๊ฐ’์˜ ๋ฒ”์œ„๋Š” ReLU๋กœ ์ธํ•ด 0์ด์ƒ์œผ๋กœ ์ œํ•œ๋˜์ง€๋งŒ, tanh๋Š” ๊ทธ ์ œ์•ฝ์ด ์—†์–ด ์ถ”์ •๋  ์ˆ˜ ์žˆ๋Š” W์™€ b์˜ Parameter๊ฐ’์˜ ์ œ์•ฝ์ด ์—†๋‹ค.
  • 42.
    42 Deep Dive intoDeep Learning : Exploration of CNN & RNN ์ง€๊ธˆ๊นŒ์ง€ ์„ค๋ช…ํ•œ ๊ตฌ์กฐ๋ฅผ Vanilla RNN ์ด๋ผ ํ•œ๋‹ค. Sequence๊ฐ€ ๊ธด ๊ตฌ์กฐ์—์„œ Vanilla RNN์€ Gradient๊ฐ€ ์ ์  ๊ฐ์†Œ/๋ฐœ์‚ฐํ•˜๋Š” Vanishing/Exploding Gradient Problem์ด ๋ฐœ์ƒํ•œ๋‹ค. ์ฆ‰, ์˜ค๋ž˜๋œ ๊ณผ๊ฑฐ์˜ ์ •๋ณด๋ฅผ ํ•™์Šตํ•˜์ง€ ๋ชปํ•œ๋‹ค. ์ด๋Ÿฌํ•œ ๋ฌธ์ œ๋ฅผ ์™„ํ™”์‹œํ‚ค๊ธฐ ์œ„ํ•ด ๋‚˜์˜จ ๋ชจ๋ธ์ด Long Short Term Memory(LSTM) ์ด๋‹ค.
  • 43.
    43 Deep Dive intoDeep Learning : Exploration of CNN & RNN LSTM ์˜ ๊ธฐ๋ณธ ๊ตฌ์กฐ๋Š” Vanilla RNN ๊ตฌ์กฐ์™€ ์œ ์‚ฌํ•˜๋‚˜, Cell ๋‚ด๋ถ€ ๊ตฌ์กฐ๊ฐ€ ์กฐ๊ธˆ ๋” ๋ณต์žกํ•˜๋‹ค. ๐ˆ ๐ˆ ๐ˆtanh tanh ๐ˆ ๐ˆ ๐ˆtanh tanh ๐ˆ ๐ˆ ๐ˆtanh tanh ๐‘ฟ ๐ŸŽ ๐‘ฟ ๐Ÿ ๐‘ฟ ๐Ÿ ๐’‰ ๐ŸŽ ๐’‰ ๐Ÿ ๐’‰ ๐Ÿ
  • 44.
    44 Deep Dive intoDeep Learning : Exploration of CNN & RNN LSTM ๐’‡ ๐’• = ๐ˆ ๐‘พ ๐’™๐’‰_๐’‡ ๐’™๐’• + ๐‘พ ๐’‰๐’‰_๐’‡ ๐’‰๐’•โˆ’๐Ÿ + ๐’ƒ ๐’‰_๐’‡ ๐ˆ ๐ˆ ๐ˆtanh tanh ๐‘ฟ ๐’• ๐’‰ ๐’• ๐’„ ๐’•โˆ’๐Ÿ ๐’‡ ๐’• ๐’Š๐’• ๐’ˆ ๐’• ๐’๐’• ๐’„ ๐’• ๐’‰ ๐’• LSTM์˜ ๊ธฐ๋ณธ ๊ตฌ์กฐ๋ฅผ ์‚ดํŽด๋ณด๋ฉด, Sequence ๊ฐ„ ์—ฐ๊ฒฐ์„ ํ•˜๋Š” ๐’„ ๐’•๋Š” ์—ฐ์‚ฐ์ด ๋ง์…ˆ์œผ๋กœ ๋˜์–ด ์žˆ์–ด ์žฅ๊ธฐ๊ฐ„ ํ•™์Šต์ด ๊ฐ€๋Šฅํ•˜๋‹ค! ๐’Š๐’• = ๐ˆ ๐‘พ ๐’™๐’‰_๐’Š ๐’™๐’• + ๐‘พ ๐’‰๐’‰_๐’Š ๐’‰ ๐’•โˆ’๐Ÿ + ๐’ƒ ๐’‰_๐’Š ๐’๐’• = ๐ˆ ๐‘พ ๐’™๐’‰_๐’ ๐’™๐’• + ๐‘พ ๐’‰๐’‰_๐’ ๐’‰ ๐’•โˆ’๐Ÿ + ๐’ƒ ๐’‰_๐’ ๐’ˆ ๐’• = ๐’•๐’‚๐’๐’‰ ๐‘พ ๐’™๐’‰_๐’ˆ ๐’™๐’• + ๐‘พ ๐’‰๐’‰_๐’ˆ ๐’‰ ๐’•โˆ’๐Ÿ + ๐’ƒ ๐’‰_๐’ˆ ๐’„ ๐’• = ๐’‡ ๐’•โŠ™๐’„ ๐’•โˆ’๐Ÿ + ๐’Š๐’•โŠ™๐’ˆ ๐’• ๐’‰ ๐’• = ๐’๐’•โŠ™๐’•๐’‚๐’๐’‰(๐’„ ๐’•)
  • 45.
    45 Deep Dive intoDeep Learning : Exploration of CNN & RNN ์ž, ์ด์ œ RNN์— ๋Œ€ํ•œ ๊ธฐ๋ณธ์ ์ธ ์ด๋ก ์€ ๋‹ค๋ฃจ์—ˆ๊ณ , ๊ฐ„๋‹จํ•œ ์‹ค์Šต์„ ํ†ตํ•ด ์‹ค์งˆ์ ์ธ Working Knowledge๋ฅผ ์Œ“์•„๋ณด์ž!
  • 46.
    46 Deep Dive intoDeep Learning : Exploration of CNN & RNN RNN์œผ๋กœ ํ•  ์ˆ˜ ์žˆ๋Š” ๋Œ€ํ‘œ์ ์ธ ์—ฐ๊ตฌ ๋ถ„์•ผ๋Š”, 1.์ž์—ฐ์–ด์ฒ˜๋ฆฌ(๋ฒˆ์—ญ, ์ฑ—๋ด‡, ์‹œ์“ฐ๊ธฐโ€ฆ) 2.์‹œ๊ณ„์—ด ์˜ˆ์ธก(์ฃผ๊ฐ€) 3.์Œ์„ฑ์ธ์‹ ๋“ฑ๋“ฑโ€ฆ ๋งŽ๋‹ค!
  • 47.
    47 Deep Dive intoDeep Learning : Exploration of CNN & RNN ์ด ์ค‘์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ (์ƒ๋Œ€์ ์œผ๋กœ) ๊ตฌํ•˜๊ธฐ ์‰ฝ๊ณ  ์ „ ์ฒ˜๋ฆฌ ๊ณผ์ •์ด (์ƒ๋Œ€์ ์œผ๋กœ) ์ ๊ฒŒ ์š”๊ตฌ๋˜๋Š” ์ฃผ๊ฐ€ ์˜ˆ์ธก ๊ธฐ๋ณธ ๋ฐ์ดํ„ฐ๋ฅผ ํ™œ์šฉํ•˜์—ฌ ๊ฐ„๋‹จํ•œ ์‹ค์Šต์„ ํ•ด๋ณด์ž!
  • 48.
    48 Deep Dive intoDeep Learning : Exploration of CNN & RNN โ€œ์ˆœ์ฐจโ€๋ผ๊ณ  ํ–ˆ๋Š”๋ฐโ€ฆ ๊ทธ๋Ÿฌ๋ฉด ๋ฐ์ดํ„ฐ๋ฅผ ์ž…๋ ฅํ•˜๊ธฐ ์œ„ํ•ด์„œ ์–ด๋–ค ๊ณผ์ •์ด ํ•„์š”ํ• ๊นŒ? โ€ข Sequence ๊ธธ์ด (์—ฐ์†์  ์‚ฌ๊ฑด์˜ ์ˆ˜) ๏ƒ  ์–ด๋–ค ํ•œ ์‹œ์ ์„ ์˜ˆ์ธกํ•˜๋Š”๋ฐ ๊ณผ๊ฑฐ ๋ช‡ ๊ฐœ์˜ ์‹œ์ ์˜ ์‚ฌ๊ฑด์ด ์˜ํ–ฅ์„ ๋ผ์ณค๋Š”๊ฐ€? โ€ข ๋…๋ฆฝ๋ณ€์ˆ˜์™€ ์ข…์†๋ณ€์ˆ˜์˜ ์ˆœ์ฐจ์  ์ž…๋ ฅ ๏ƒ  ๊ณผ๊ฑฐ Sequence ๊ธธ์ด ๋งŒํผ ํ•œ ์‹œ์  ์”ฉ ์ด๋™ ํ•ด๊ฐ€๋ฉด์„œ ์ž…๋ ฅ 1. Normalization 2. Sequence 3. Rolling Window MinMax ์ •๊ทœํ™” 0 < ๐‘‹ โˆ’ ๐‘€๐‘–๐‘›(๐‘‹) ๐‘€๐‘Ž๐‘ฅ ๐‘‹ โˆ’ ๐‘€๐‘–๐‘›(๐‘‹) < 1
  • 49.
    49 Deep Dive intoDeep Learning : Exploration of CNN & RNN ๋ณ€์ˆ˜์˜ ๋‹จ์œ„๊ฐ€ ๋‹ฌ๋ผ์„œ ๋ณ€์ˆ˜ ๊ฐ„ ํฌ๊ธฐ ์ฐจ์ด๊ฐ€ ํฌ๋ฉฐ, ์ด๋Š” ์ •ํ™•ํ•œ Parameter ์ถ”์ •์ด ์•ˆ๋œ๋‹ค. MinMax ์ •๊ทœํ™” 0 < ๐‘‹ โˆ’ ๐‘€๐‘–๐‘›(๐‘‹) ๐‘€๐‘Ž๐‘ฅ ๐‘‹ โˆ’ ๐‘€๐‘–๐‘›(๐‘‹) < 1 1. Normalization ์ฃผ์‹๊ฐ€๊ฒฉ (US Dollar, $) ๊ฑด ์ˆ˜
  • 50.
    50 Deep Dive intoDeep Learning : Exploration of CNN & RNN 2. Sequence ๋ช‡ ์ผ ์ „๊นŒ์ง€์˜ ์ฃผ์‹ ๊ฐ€๊ฒฉ์ด ๋‹ค์Œ ๋‚  ์ฃผ์‹ ๊ฐ€๊ฒฉ์— ์˜ํ–ฅ์„ ๋ฏธ์น ๊นŒ? ๋”ฐ๋ผ์„œ Sequence๋Š” 5! 5์ผ! ์ •ํ™•ํ•˜๊ฒŒ ์•Œ ์ˆ˜๋Š” ์—†์ง€๋งŒ, ์ฃผ๋ง์—๋Š” ์žฅ์ด ์•ˆ ์—ด๋ฆฌ๋‹ˆ ์ด๋ฅผ ๊ณ ๋ คํ•ด 1์ฃผ์ผ ์น˜๋ฅผ ๋ณด๊ณ  ๋‹ค์Œ ๋‚  ์ข…๊ฐ€๋ฅผ ์˜ˆ์ธกํ•ด ๋ณด์ž!
  • 51.
    51 Deep Dive intoDeep Learning : Exploration of CNN & RNN 3. Rolling Window Rolling Window๋Š” ๋˜ ๋ญ”๊ฐ€โ€ฆ? ์šฉ์–ด์— ์ซ„์ง€ ๋ง์ž!!! Sequence์˜ ๊ธธ์ด์ธ 5์ผ์น˜ ๋ฐ์ดํ„ฐ์— ๋งž์ถ”์–ด์„œ ๋…๋ฆฝ๋ณ€์ˆ˜ X์™€ ์ข…์†๋ณ€์ˆ˜ Y๋ฅผ ์ˆœ์ฐจ์ ์œผ๋กœ ์„ค์ •ํ•˜๋Š” ๊ฒƒ์„ ๋งํ•œ๋‹ค! ๐‘‹ 1 = ๐‘‹1, ๐‘‹2 , ๐‘‹3, ๐‘‹4, ๐‘‹5 ๐‘Œ 1 = ๐‘Œ6
  • 52.
    52 Deep Dive intoDeep Learning : Exploration of CNN & RNN 3. Rolling Window Rolling Window๋Š” ๋˜ ๋ญ”๊ฐ€โ€ฆ? ์šฉ์–ด์— ์ซ„์ง€ ๋ง์ž!!! Sequence์˜ ๊ธธ์ด์ธ 5์ผ์น˜ ๋ฐ์ดํ„ฐ์— ๋งž์ถ”์–ด์„œ ๋…๋ฆฝ๋ณ€์ˆ˜ X์™€ ์ข…์†๋ณ€์ˆ˜ Y๋ฅผ ์ˆœ์ฐจ์ ์œผ๋กœ ์„ค์ •ํ•˜๋Š” ๊ฒƒ์„ ๋งํ•œ๋‹ค! ๐‘‹ 1 = ๐‘‹1, ๐‘‹2 , ๐‘‹3, ๐‘‹4, ๐‘‹5 ๐‘‹ 2 = ๐‘‹2, ๐‘‹3 , ๐‘‹4, ๐‘‹5, ๐‘‹6 ๐‘Œ 2 = ๐‘Œ7 ๐‘Œ 1 = ๐‘Œ6
  • 53.
    53 Deep Dive intoDeep Learning : Exploration of CNN & RNN 3. Rolling Window Rolling Window๋Š” ๋˜ ๋ญ”๊ฐ€โ€ฆ? ์šฉ์–ด์— ์ซ„์ง€ ๋ง์ž!!! Sequence์˜ ๊ธธ์ด์ธ 5์ผ์น˜ ๋ฐ์ดํ„ฐ์— ๋งž์ถ”์–ด์„œ ๋…๋ฆฝ๋ณ€์ˆ˜ X์™€ ์ข…์†๋ณ€์ˆ˜ Y๋ฅผ ์ˆœ์ฐจ์ ์œผ๋กœ ์„ค์ •ํ•˜๋Š” ๊ฒƒ์„ ๋งํ•œ๋‹ค! ๐‘‹ 1 = ๐‘‹1, ๐‘‹2 , ๐‘‹3, ๐‘‹4, ๐‘‹5 ๐‘‹ 2 = ๐‘‹2, ๐‘‹3 , ๐‘‹4, ๐‘‹5, ๐‘‹6 ๐‘‹ 3 = ๐‘‹3, ๐‘‹4 , ๐‘‹5, ๐‘‹6, ๐‘‹7 ๐‘Œ 2 = ๐‘Œ7 ๐‘Œ 3 = ๐‘Œ8 ๐‘Œ 1 = ๐‘Œ6
  • 54.
    54 Deep Dive intoDeep Learning : Exploration of CNN & RNN ์ง€๊ธˆ๊นŒ์ง€ ์„ค๋ช…ํ•œ ๋ฐ์ดํ„ฐ ์ „ ์ฒ˜๋ฆฌ ์ฝ”๋“œ๋ฅผ ์‚ดํŽด๋ณด์ž!
  • 55.
    55 Deep Dive intoDeep Learning : Exploration of CNN & RNN โ€ข Sequence ๊ธธ์ด (์—ฐ์†์  ์‚ฌ๊ฑด์˜ ์ˆ˜) ๏ƒ  ์–ด๋–ค ํ•œ ์‹œ์ ์„ ์˜ˆ์ธกํ•˜๋Š”๋ฐ ๊ณผ๊ฑฐ ๋ช‡ ๊ฐœ์˜ ์‹œ์ ์˜ ์‚ฌ๊ฑด์ด ์˜ํ–ฅ์„ ๋ผ์ณค๋Š”๊ฐ€? โ€ข ๋…๋ฆฝ๋ณ€์ˆ˜์™€ ์ข…์†๋ณ€์ˆ˜์˜ ์ˆœ์ฐจ์  ์ž…๋ ฅ ๏ƒ  ๊ณผ๊ฑฐ Sequence ๊ธธ์ด ๋งŒํผ ํ•œ ์‹œ์  ์”ฉ ์ด๋™ ํ•ด๊ฐ€๋ฉด์„œ ์ž…๋ ฅ 1. Normalization 2. Sequence 3. Rolling Window MinMax ์ •๊ทœํ™” 0 < ๐‘‹ โˆ’ ๐‘€๐‘–๐‘›(๐‘‹) ๐‘€๐‘Ž๐‘ฅ ๐‘‹ โˆ’ ๐‘€๐‘–๐‘›(๐‘‹) < 1
  • 56.
    56 Deep Dive intoDeep Learning : Exploration of CNN & RNN โ€ข Sequence ๊ธธ์ด (์—ฐ์†์  ์‚ฌ๊ฑด์˜ ์ˆ˜) ๏ƒ  ์–ด๋–ค ํ•œ ์‹œ์ ์„ ์˜ˆ์ธกํ•˜๋Š”๋ฐ ๊ณผ๊ฑฐ ๋ช‡ ๊ฐœ์˜ ์‹œ์ ์˜ ์‚ฌ๊ฑด์ด ์˜ํ–ฅ์„ ๋ผ์ณค๋Š”๊ฐ€? โ€ข ๋…๋ฆฝ๋ณ€์ˆ˜์™€ ์ข…์†๋ณ€์ˆ˜์˜ ์ˆœ์ฐจ์  ์ž…๋ ฅ ๏ƒ  ๊ณผ๊ฑฐ Sequence ๊ธธ์ด ๋งŒํผ ํ•œ ์‹œ์  ์”ฉ ์ด๋™ ํ•ด๊ฐ€๋ฉด์„œ ์ž…๋ ฅ 1. Normalization 2. Sequence 3. Rolling Window MinMax ์ •๊ทœํ™” 0 < ๐‘‹ โˆ’ ๐‘€๐‘–๐‘›(๐‘‹) ๐‘€๐‘Ž๐‘ฅ ๐‘‹ โˆ’ ๐‘€๐‘–๐‘›(๐‘‹) < 1 ๋”ฐ๋ผ์„œ Sequence๋Š” 5! 1์ฃผ์ผ ๋™์•ˆ์˜ Working Days๊ฐ€ ๋‹ค์Œ ์‹œ์ ์˜ ์ข…๊ฐ€์— ์˜ํ–ฅ์„ ๋ฏธ์นœ๋‹ค๊ณ  ๊ฐ€์ •
  • 57.
    57 Deep Dive intoDeep Learning : Exploration of CNN & RNN โ€ข Sequence ๊ธธ์ด (์—ฐ์†์  ์‚ฌ๊ฑด์˜ ์ˆ˜) ๏ƒ  ์–ด๋–ค ํ•œ ์‹œ์ ์„ ์˜ˆ์ธกํ•˜๋Š”๋ฐ ๊ณผ๊ฑฐ ๋ช‡ ๊ฐœ์˜ ์‹œ์ ์˜ ์‚ฌ๊ฑด์ด ์˜ํ–ฅ์„ ๋ผ์ณค๋Š”๊ฐ€? โ€ข ๋…๋ฆฝ๋ณ€์ˆ˜์™€ ์ข…์†๋ณ€์ˆ˜์˜ ์ˆœ์ฐจ์  ์ž…๋ ฅ ๏ƒ  ๊ณผ๊ฑฐ Sequence ๊ธธ์ด ๋งŒํผ ํ•œ ์‹œ์  ์”ฉ ์ด๋™ ํ•ด๊ฐ€๋ฉด์„œ ์ž…๋ ฅ 1. Normalization 2. Sequence 3. Rolling Window MinMax ์ •๊ทœํ™” 0 < ๐‘‹ โˆ’ ๐‘€๐‘–๐‘›(๐‘‹) ๐‘€๐‘Ž๐‘ฅ ๐‘‹ โˆ’ ๐‘€๐‘–๐‘›(๐‘‹) < 1
  • 58.
    58 Deep Dive intoDeep Learning : Exploration of CNN & RNN Data Setting์ด ๋๋‚˜๋ฉด Tensorflow๋ฅผ ํ™œ์šฉํ•˜์—ฌ 1๊ฐœ ์ธต์˜ LSTM ๋ชจ๋ธ ๊ทธ๋ž˜ํ”„๋ฅผ ๊ตฌ์ถ•ํ•ด ๋ณด์ž. ๋จผ์ € Hidden Layer์ธ Cell์„ ๋งŒ๋“œ๋Š”๋ฐ, ์œ„์™€ ๊ฐ™์ด ์ฝ”๋“œ ํ•œ ์ค„๋กœ ๋๋‚œ๋‹ค. ๋ณต์žกํ•œ ์ด๋ก ์ด ๋ฌด์ƒ‰ํ•˜๊ฒŒ ๊ต‰.์žฅ.ํžˆ. ์‹ฌ.ํ”Œ.ํ•˜๋‹ค.
  • 59.
    59 Deep Dive intoDeep Learning : Exploration of CNN & RNN ๊ทธ๋Ÿฐ๋ฐ ์ด dynamic_rnn์ด๋ผ๋Š” ๊ฒƒ์€ ๋ญ˜๊นŒ? 1๊ฐœ์˜ Cell์„ ๊ตฌ์ถ•ํ•œ ํ›„, y๊ฐ’๋“ค์„ ์‚ฐ์ถœํ•˜๋„๋ก rnn Tensorflow ์ฝ”๋“œ์— ๋„ฃ๋Š”๋‹ค.
  • 60.
    60 Deep Dive intoDeep Learning : Exploration of CNN & RNN ๋งŒ์•ฝ ์˜์–ด๋ฅผ ํ•œ๊ตญ์–ด๋กœ ๋ฒˆ์—ญํ•˜๋Š” RNN๋ชจ๋ธ์„ ๊ตฌ์ถ•ํ•œ๋‹ค๊ณ  ํ•˜๋ฉด, ์ž…๋ ฅ๋˜๋Š” ๋‹จ์–ด์˜ ๊ธธ์ด ๋ฐ ๊ฐœ์ˆ˜๊ฐ€ ๋‹ค๋ฅด๊ธฐ ๋•Œ๋ฌธ์— ์ผ์ •ํ•œ ๊ธธ์ด์˜ sequence๋กœ Input์ด ๋“ค์–ด์˜ค์ง€ ์•Š๋Š”๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, Show me the money. (sequence 4) He is handsome. (sequence 3) ์„ ๋ฒˆ์—ญํ•œ๋‹ค๊ณ  ํ•˜๋ฉด, ์„œ๋กœ ๋‹ค๋ฅธ Sequence๋ฅผ ์ฒ˜๋ฆฌํ•ด์•ผ ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์ž…๋ ฅ ๊ฐ’์˜ ๊ธธ์ด์™€ ์ถœ๋ ฅ ๊ฐ’์˜ ๊ธธ์ด๊ฐ€ ์œ ๋™์ ์ด์–ด์•ผ ํ•œ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์ด๋ฅผ ๊ฐ€๋Šฅํ•˜๊ฒŒ ํ•˜๋Š” ๊ฒƒ์ด dynamic RNN์ด๋‹ค!
  • 61.
    61 Deep Dive intoDeep Learning : Exploration of CNN & RNN ์ดํ•ด๋ฅผ ๋•๊ธฐ ์œ„ํ•ด RNN ๊ทธ๋ž˜ํ”„๋กœ ์‚ดํŽด๋ณด๋ฉดโ€ฆ
  • 62.
    62 Deep Dive intoDeep Learning : Exploration of CNN & RNN A ๐‘ฟ ๐’• ๐’‰ ๐’• ๐‘ฟ ๐ŸŽ ๐’‰ ๐ŸŽ A ๐‘ฟ ๐Ÿ ๐’‰ ๐Ÿ A ๐‘ฟ ๐Ÿ ๐’‰ ๐Ÿ A ๐‘ฟ ๐’• ๐’‰ ๐’• A โ€ฆ = ๋ฒˆ์—ญ์˜ ๊ฒฝ์šฐ outputs์œผ๋กœ ์ถœ๋ ฅ๋˜๋Š” ๋ชจ๋“  ์‚ฐ์ถœ ๊ฐ’์„ ์‚ฌ์šฉ ์ฃผ๊ฐ€ ์˜ˆ์ธก์€ โ€œ์ข…๊ฐ€โ€์—๋งŒ ๊ด€์‹ฌ์ด ์žˆ์œผ๋ฏ€๋กœ ๐’‰ ๐’•๋งŒ ์‚ฌ์šฉ ๊ด€์‹ฌ์‚ฌํ•ญ โ€œ์ข…๊ฐ€โ€ โ„Ž ๐‘ก๊ฐ’๋งŒ ์ถ”์ถœํ•˜๊ธฐ ์œ„ํ•ด tf.transpose ํ•จ์ˆ˜ ์‚ฌ์šฉ
  • 63.
    63 Deep Dive intoDeep Learning : Exploration of CNN & RNN ๊ฒฐ๊ณผ
  • 64.
    64 Deep Dive intoDeep Learning : Exploration of CNN & RNN End of Document Thank You for Listening
  • 65.
    65 Deep Dive intoDeep Learning : Exploration of CNN & RNN ์ฐธ๊ณ ๋ฌธํ—Œ http://aikorea.org/blog/rnn-tutorial-3/ https://laonple.blog.me/ https://ratsgo.github.io/ https://m.blog.naver.com/PostView.nhn?blogId=infoefficien&logNo=221210061511&tar getKeyword=&targetRecommendationCode=1https://github.com/hunkim/DeepLearning ZeroToAll ๋งํฌ Ba, J. L., Kiros, J. R., & Hinton, G. E. (2016). Layer normalization. arXiv preprint arXiv:1607.06450. Long, J., Shelhamer, E., & Darrell, T. (2015). Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 3431-3440). Courville, A. (2016). Recurrent Batch Normalization. arXiv preprint arXiv:1603.09025. Simonyan, K., & Zisserman, A. (2014). Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556. ๋…ผ๋ฌธ