Spicy Tuna Sushi
본문 바로가기
부스트캠프 AI Tech

Seq2Seq

by 말린malin 2022. 10. 23.

<RNN과 Attention을 결합한 sequence to sequence 모델>

 

- 각 단어마다 발생하는 hidden state vector들을 전체적으로 Decoder에 제공

Decoder는 Time step마다 그때그때 필요한 h를 선별적으로 가져와서 예측에 도움이 되는 형태로 사용함

 

https://google.github.io/seq2seq/

 

Overview - seq2seq

Introduction tf-seq2seq is a general-purpose encoder-decoder framework for Tensorflow that can be used for Machine Translation, Text Summarization, Conversational Modeling, Image Captioning, and more. Design Goals We built tf-seq2seq with the following goa

google.github.io

- 디코더 h1이 인코더 h와 각각 내적연산
- 가중 평균으로 하나의 인코딩 벡터를 구함=context vector

 

- 디코더의 h와 attention module의 output vector(context vector)가 concat되어 입력으로 들어가 예측

- 다음 타입스텝에서는 디코더의 새로운 h를 갖고 같은 방식으로 수행됨. eos가 나올 때까지

 

- h(d) : 인코딩 벡터의 attention 가중치를 결정/ 예측 목적의 입력으로 사용

 

score 구하는 다양한 방식

 

<실습>

- Encoder 구현
- Decoder 구현
- Seq2seq 모델 구축 및 사용

- Dot-Production attention 구현

- Concat Attention 구현

'부스트캠프 AI Tech' 카테고리의 다른 글

Self-supervised Pre-training Models  (0) 2022.10.23
Beam Search and BLEU score  (0) 2022.10.23
RNN, LSTM, GRU  (0) 2022.10.12
Word Embedding: Word2Vec, GloVe  (0) 2022.10.11
22-10-11 깃헙특강  (0) 2022.10.11

댓글