본문 바로가기

자연어 처리

JinCoding 실무형 NLP Course 5강 : Transfomer 실습 - 23-08-20

[Transformers]

  • Architecture
  • Decoder

Masked multi-head self-attention

Encoder-decoder multi-head attention

  • Output
  • Training Parameters

 

[실습]

  • BERT 기반 한국어 감성 분류 모델 개발
  • PyTorch Transformer 구현

 

Decoder

Masked multi-head self-attention

“Auto-regressive” : 이전 정보(regressive)를 이용해서

현재 정보(auto)를 예측

 

현재 토큰 위치 : t

0 , 1, …., t까지 토큰들의 attention score 계산

t+1, …, mask 씌움 (-infinite)

 

Auto-regressive : 이전 정보를 이용해서 현재정보를 예측하는 특성 

Mask: row index < column index

 

softmax(- infinite )  = 0

 

loss를 한번에 업데이트