수업 정리
1. [NLP] Sequence to Sequence with Attention
- Sequence to Sequence

- it takes a sequence of words as input and gives a sequence of words as output
- it composed of an encoder and a decoder
- Sequence to Sequene with attention

- Use the attention distribution to takse a weighted sum of the encoder hidden states
- The attention output mostly contains information the hidden states that received high attention
- Concatenate attention output with decoder hidden state, then use to compute y1^ as before
- Teacher forcing을 사용할 경우 학습이 더 빠르고 용이하게 진행되지만, test time에서 실제 모델을 사용하는 환경과는 다른 괴리를 갖기 때문에 적절하게 사용하는 학습방식도 존재(Teacher forcing ratio?)
- Attention significantly improves NMT performance
- It is useful to allow the decoder to focus on particular parts of the source
- Attention solves the bottleneck problem
- Attention allows the decoder to look directly at source; bypass the bottleneck
- Attention helps with vanishing gradient problem
- Provides a shortcut to far-away states
- Attention provides some interpretability
- By inspecting attention distribution, we can see what the decoder was focusing on
- The network just learned alignment by itself
- Differnet Attention mechanism
score(ht,hs)=⎩⎪⎪⎨⎪⎪⎧ht⊤hsht⊤Wahˉsva⊤tanh(Wa[ht;hs]) dot general concat
- Luong :
- they get the decoder hidden state at time t, then calculate attention scores, and from that get the context vector which will be concatenated with hidden state of the decoder and then predict the output.
- Luong has different types of alignments. Bahdanau has only a concat-score alignment model.
- Bahdanau :
- At time t, we consider the hidden state of the decoder at time t−1. Then we calculate the alignment, context vectors as above. But then we concatenate this context with hidden state of the decoder at time t−1. So before the softmax, this concatenated vector goes inside a LSTM unit.
2. [NLP] Beam Search and BLEU score
Beam Search
BLEU score
피어세션 정리
강의 내용 관련
Further Question
- BLEU score가 번역 문장 평가에 있어서 갖는 단점은 무엇이 있을까요?
과제 내용 관련
- 질문) 필수과제 4번에서, process 함수 만들 때, try, except을 활용해서 조금 더 빠르게 동작하는 코드를 작성하라고 했는데 어떤 식으로 가능한지 궁금합니다.
- Bucketing
- 트랜스포머 내에서도 배치 단위 안에서 유사한 길이로 하면 행렬 연산할 때 이점이 있을 것 같다.
- Tensorflow에서는 RNN의 cell 개수를 fix 하기 때문에 헷갈리기 쉬웠다.
- Batch_first = True 자주 쓰이는지 → 멘토님께 질문
기타

- 구현 후 테스트해보기 좋은 데이터셋
느낀점
오늘부터 다음 p_stage에서 함께할 조원들 명단을 받기 시작했습니다... 알아서 팀을 구성하라고 하는데 이런거 잘 못하지만,,,,,, 남은 부스트캠프를 전부 함께해야하는 팀이니깐 화이팅,,,,