#776 · Primary category: Education & Research

pytorch-original-transformer

attention attention-is-all-you-need attention-mechanism deep-learning deeplearning jupyter original-transformer python pytorch pytorch-transformer pytorch-transformers transformer transformer-tutorial transformers

My implementation of the original transformer model (Vaswani et al.). I've additionally included the playground.py file for visualizing otherwise seemingly hard concepts. Currently included IWSLT pretrained models.

Project last updated:12/27/20

GitHub Stars

1.1K

Forks

188

Contributors

1

License

MIT

Why we included this project

This repo is a readable PyTorch port of the original transformer architecture from Vaswani et al., written for learning rather than for chasing leaderboard numbers. The code is heavily commented, so each component is explained in place instead of arriving as an opaque library call. The playground.py script is the part worth checking first: it visualizes positional encodings and the custom learning-rate schedule, ideas that are easy to describe in prose but hard to picture from the formulas alone. Pretrained IWSLT translation models and a companion notebook give you something real to run once the theory starts to click. For students or self-taught engineers trying to understand the ideas behind modern LLMs, this is a friendly place to build that intuition before moving on to higher-level frameworks.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category