Prototypical Networks (Snell, Swersky & Zemel, 2017) solve N-way K-shot classification by mapping every example into an embedding space fθ(x) and representing each class by a single point — its prototype: the mean of its support embeddings.
c_k = (1/|S_k|) · Σ_(x_i,y_i)∈S_k f_θ(x_i)
p(y=k | x) = softmax_k( −d(f_θ(x), c_k) )
= exp(−d(f_θ(x),c_k)) / Σ_k' exp(−d(f_θ(x),c_k'))
ŷ = argmin_k d(f_θ(x), c_k) (squared Euclidean d)
The 3D scene renders this exact geometry through a perspective camera you orbit with a mouse drag. This page recomputes prototypes, nearest-neighbour classification and the Voronoi field independently from scratch and instead gives you a true top-down 2D map: drag to pan, scroll/pinch to zoom, so you can inspect any corner of the decision boundary at full resolution — something the 3D view's fixed field-of-view can't offer. A bottom panel the 3D scene has no room for tracks live per-class accuracy and average distance-to-prototype as bars, so you can see exactly which classes the current episode confuses.
- Filled dots are the support set — the few labelled examples per class averaged into each prototype (◆ diamond).
- Rings are the query set — unlabelled points classified purely by nearest-prototype distance; green ring = correct, red = wrong.
- The tinted field is the induced Voronoi decision map: every location's colour is whichever prototype is closest, the same boundary a real embedding-space classifier draws.
Increasing K averages out noise and pulls prototypes toward the true cluster centre — watch the per-class bars tighten (lower distance, higher accuracy) as K-shot grows, with no change to the classification rule itself.