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.
23 write-ups
| Title |
|---|
| Conv2D from Scratch A 2D convolution forward pass in NumPy with padding and stride, from six nested loops to im2col and one matrix product, plus max pooling, the backward pass and tests against PyTorch. |
| 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. |