상세 컨텐츠

본문 제목

0125

SKT fly ai challenger

by jii 2025. 1. 25. 16:29

본문

<Self Attention 계산과정>

 

Attention 계산 과정.pdf
0.87MB

 


<Cross Attention 계산과정>

 

= encoder - decoder attention

 

-self attention : 이미 생성한 단어들 간의 문맥

-cross attention : encoder 결과에서 필요한 정보 가져옴

 

-Q는 decoder의 현재 상태에서

-K, V는 encoder의 출력(hidden state, 은닉 벡터)에서 가져옴

 

Cross-Attention 계산 과정.pdf
0.71MB

 

 

 


<ViT>

 

-이미지를 cnn대신 transformer로 처리

-이미지를 patch로 분할해 transformer encoder 입력으로 넣음

-self attention을 통해 전역 정보를 병렬로 학습 가능 -> 대규모 dataset에서 유리

 

1. 입력 이미지 패치 분할

2. linear projection of flattened patches

3. class token(이미지 전체를 대표하는 임베딩)과 위치 임베딩(위치 정보 제공)

4. 초기 임베딩 z0

 

 

 

*LN : 입력 벡터 (길이 D) 단위로 평균 / 분산 계산 


https://drive.google.com/file/d/1ZiZfi3HbG8cdSnb764WAhlruhZm2Qe7J/view?usp=sharing

 

ViT 코드 구현_간략.ipynb

Colab notebook

drive.google.com

https://drive.google.com/file/d/1wLCeDSMdute--SVDnyVMb1kSTA9MWuPZ/view?usp=sharing

 

인코더_디코더_모델.ipynb

Colab notebook

drive.google.com

 

'SKT fly ai challenger' 카테고리의 다른 글

0124  (0) 2025.01.24
0123  (0) 2025.01.23
0122  (0) 2025.01.23
0121  (0) 2025.01.21
0120  (0) 2025.01.20

관련글 더보기

댓글 영역