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.
2 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. |
| A Transformer Block A transformer encoder layer in PyTorch, from a block without residuals to post-norm and pre-norm, matched against nn.TransformerEncoderLayer, plus a one-layer NumPy transformer and an attention-free variant. |