Prerequisites & Notation

Before You Begin

This chapter requires nn.Module (Chapter 26) and understanding of sequence modelling (Chapter 29).

  • nn.Module and training (Chapter 26)(Review ch26)

    Self-check: Can you implement and train custom modules?

  • Sequence models and hidden states (Chapter 29)(Review ch29)

    Self-check: Do you understand encoder-decoder and sequence processing?

Notation for This Chapter

SymbolMeaningIntroduced
mathbfQ,mathbfK,mathbfV\\mathbf{Q}, \\mathbf{K}, \\mathbf{V}Query, key, value matricess01
dkd_kDimension of key/query vectorss01
dtextmodeld_{\\text{model}}Model embedding dimensions02
hhNumber of attention headss01
NNNumber of transformer layers (blocks)s02