NumPy Puzzle: 1-NN Vectorization → Wx+b Network
Medium · ML Coding · 60 min
Vectorize batch L2 1-NN in NumPy via a single matrix multiplication, rewrite it as an exact Wx+b linear layer plus softmax, construct an L1 1-NN using a single-hidden-layer ReLU network, and handle soft-NN temperature scaling and batched inference.
This is a Pro problem. Pro unlocks the full prompt, a step-by-step walkthrough, a reference solution and tests you can run.
More OpenAI problems
- Infection Spread / Cellular Automata
- GPU Credits / GPU Credit 2
- Social Network / Follow Graph
- Poker Simulation
- Classifier with Noisy Annotators
- Durable Key-Value Store Serialization
- Memory Allocator
- Transformer Bug Hunt
- Distributed Machine Cluster Count and Topology
- Autograd / Manual Backprop + Hillis-Steele Scan