RNN

 

RNN이 필요한 이유?

  • 각 example마다 input과 output의 길이가 다를 수 있기 때문에
  • 텍스트의 각기 다른 위치지만 가중치를 공유할 수 있기 때문에

 


RNN의 구조

  • shared parameter 이용
  • 이전 time step의 정보를 활용할 수 있다.
    • 앞의 time step을 이용하기 위해서는 bidirectional RNN을 사용해야 한다.

 


RNN forward

$$ a^{<t>} = g(W_{hh}a^{<t-1>} + W_{hx}x^{<t>}+b_h) $$

$$ = g(W_h[a^{<t-1>}, x^{<t>}]+b_h) $$

 

$$ o^{<t>} = g(W_{oh}a^{<t>}+b_o) $$

 


RNN backward

https://excelsior-cjh.tistory.com/184

$$ L(\hat y, y) = \sum_{t=1}^{T_y} L(\hat y^{<t>}, y^{<t>}) $$

 

(보충 필요)

 

 


RNN 종류

 

  • one to one
  • one to many
    • image captioning
  • many to one
    • sentiment classification
  • many to many
    • input sequence의 길이 == output sequence의 길이
      • sequence labeling (개체명인식, 띄어쓰기, 품사 부착, 형태소 분리)
    • input sequence의 길이 != output sequence의 길이
      • 기계 번역

 

'🙂 > Coursera_DL' 카테고리의 다른 글

WEEK8 : Word Embedding (word2vec)  (0) 2020.12.26
WEEK7 : LSTM, GRU  (0) 2020.12.25
WEEK7 : convNet in 1D, 2D, 3D  (0) 2020.12.25
WEEK7 : Neural Style Transfer  (1) 2020.12.25
WEEK7 : face recognition  (0) 2020.12.24

+ Recent posts