Original diagram of embedding, attention and feed-forward blocks; not model output or a performance result.

Transformer in JavaScript

Role: AuthorStatus: Personal project

I also wrote a transformer in JavaScript to learn how they work.

Original diagram of embedding, attention and feed-forward blocks; not model output or a performance result.

Role
Author
Status
Personal project

I used English and Spanish sentence pairs to follow a translation through the model. The tokenizer turns words into integers. The encoder reads the English sentence, and the decoder learns to predict the next Spanish token using the translation so far. I wrote the attention layers in TensorFlow.js to see where information passes between the two sides.

Read the transformer implementation

See how the translation experiment is set up

Back to this project on the Shelf

All project write-ups