위치 인코딩된 단어 벡터를 인코더 블록에 주입한다. 인코더는 고려 중인 단어의 앞뒤에 있는지 여부와 상
관없이 입력 시퀀스의 모든 단어를 처리하므로 트랜스포머 인코더는 양방향 인코더다.
4
디코더는 인코더의 출력 벡터와 함께 이전 시간 스텝인
t
-
1
에서의 디코더 출력 단어를 입력으로 받는다.
5
디코더에 대한 입력 데이터도 위치 인코딩에 의해 확장
augmented
된다.
6
확장된 디코더 입력은 세 개의 하위 계층으로 공급된다. 디코더는 이어지는 단어를 인식할 수 없으므로 첫
번째 하위 계층에서 마스킹
masking
을 적용한다. 두 번째 하위 계층에서 디코더는 인코더의 출력을 함께 받게
되며, 이를 통해 디코더는 입력 시퀀스의 모든 단어에 주목할 수 있다.
7
디코더의 출력은 마지막으로 완전 연결 계층과 소프트맥스 계층을 통과하여 출력 시퀀스의 다음 단어에 대
한 예측을 생성한다.
7.8.2
어텐션 메커니즘
트랜스포머의 마법은 어텐션 메커니즘 덕분이다. 어텐션 메커니즘을 사용하면 다음과 같은 이
점이 있다.
설명 가능성
explainability
모델이 특정 출력을 생성할 때 입력 문장(또는 문서)의 어느 부분에 주목했는지 나타낼 수 있
다(그림
7
-
5
).
사전 훈련된 어텐션 모델 활용
사전 훈련된 모델들을 특정 분야의 문제에 맞게 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.
O’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
I wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
I’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
I'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.