PyTorch Tutorial - nn.Transformer & torchtext
https://pytorch.org/tutorials/beginner/transformer_tutorial.html
Language Modeling with nn.Transformer and torchtext — PyTorch Tutorials 2.2.0+cu121 documentation
Note Click here to download the full example code Language Modeling with nn.Transformer and torchtext This is a tutorial on training a model to predict the next word in a sequence using the nn.Transformer module. The PyTorch 1.2 release includes a standard
pytorch.org
nn.Transformer을 활용한다면서
막상 활용하는 것은 nn.TransformerEncoder 클래스를 훈련하는
뉴비를 속이는 잔혹한 파이토치 튜토리얼을 아라보자.
Transfomer은 그 유명한 attention is all you need 논문을 활용한 클래스이다.
소스코드를 확인해보면,
nn.Transfomer은 nn.TransformerEncoder과 nn.TransformerDecoder을 활용하여
편의상 만들어진 클래스로 보인다.
유명한 LLM인 BERT는 Transformer에서 Encoder만 활용하며,
GPT는 Transformer에서 Decoder만 활용한다.
'미분류' 카테고리의 다른 글
[인생전략] 비전공 개발자 포기, 그 이후로는? (0) | 2024.02.14 |
---|---|
[개똥철학] 실패자, 그리고 까뮈를 생각하다 (1) | 2024.02.14 |
[Transformer] Positional Encoding (작성중) (0) | 2024.01.06 |
[PyTorch] torch.nn.Embedding (작성중) (0) | 2023.12.29 |
Word Embedding이란? (0) | 2023.12.29 |