ML coding
Machine learning algorithms and model parts written from scratch in NumPy and PyTorch, as ML coding rounds ask.
Machine learning algorithms and model parts written from scratch in NumPy and PyTorch, as ML coding rounds ask.
3 write-ups
| Title |
|---|
| Self-Attention from Scratch Scaled dot-product self-attention in NumPy and then PyTorch, with causal and padding masks, a stable softmax, tests, and the why-scale and why-norm questions. |
| Multi-Head and Grouped-Query Attention Multi-head causal self-attention in PyTorch, from a loop over heads to one fused projection and reshapes, then grouped-query and multi-query attention, tested against PyTorch's own. |
| Positional Encoding and RoPE Why attention needs positions, then learned and sinusoidal embeddings and rotary embeddings (RoPE) on queries and keys, with the relative-position property tested and the long-context follow-ups. |