Built & Trained a Transformer from Scratch in Pure PyTorch for English-to-Tamil Machine Translation [Math + Code Breakdown] [P]
Mirrored from r/MachineLearning for archival readability. Support the source by reading on the original site.
Hi everyone! 👋
I built and trained the complete Transformer architecture from scratch using pure PyTorch (`torch.nn` primitives) based on the original "Attention Is All You Need" paper.
I trained the model on an English-to-Tamil parallel translation dataset (`gopi30/english-tamil` on Hugging Face) using dual NVIDIA T4 GPUs on Kaggle.
I wrote a detailed mathematical breakdown and step-by-step tutorial covering every equation, tensor shape transformation, and PyTorch block.
Full Blog Post: https://imrancoder786.github.io/blog-post.html?post=transformer-from-scratch
GitHub Repository:
https://github.com/imrancoder786/ML_FROM_SCRATCH/tree/main/Transformer_from_scratch
I’d love to hear your feedback, suggestions, or any questions on the code/math!
I’d love to hear your feedback, suggestions, or any questions on the code/math!
[link] [comments]
More from r/MachineLearning
-
A collision-entropy floor for watermark/retrieval AI-text detection. Looking for a sanity check before I take this further [D]
Aug 14
-
Are supervised and unsupervised learning still relevant today? [D]
Aug 14
-
TMLR Relevance and Prestige [D]
Aug 13
-
Reproducible canvas-aligned low-level patterns in somerandomllm-generated images and their possible relation to iterative editing artifacts [D]
Aug 13
Discussion (0)
Sign in to join the discussion. Free account, 30 seconds — email code or GitHub.
Sign in →No comments yet. Sign in and be the first to say something.