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.

See Pro plans

More OpenAI problems