HomeAI & Machine LearningPrototypical Networks: Few-Shot Classification by Distance (2D)

Prototypical Networks: Few-Shot Classification by Distance (2D)

Interactive 2D prototypical-network simulator: pan and zoom a top-down embedding-space map while support points collapse into class prototypes by simple averaging, query points get classified by nearest-prototype distance, and a live per-class accuracy/distance bar panel tracks the same Voronoi decision boundary the 3D version renders, computed independently from scratch.

AI & Machine Learning2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-ds-topic-76 ↗ Open standalone

This 2D companion to the 3D Prototypical Networks scene keeps the exact same governing rule — a class prototype is the mean of its few labelled support embeddings, and a query point is classified by whichever prototype it lands nearest — but computes prototypes, nearest-neighbour classification and the Voronoi decision field independently, from a true top-down map instead of a perspective camera. Drag to pan and scroll to zoom into any region of the embedding space, adjust N-way, K-shot and cluster spread to resample a fresh episode, and watch a dedicated per-class panel track live accuracy and average distance-to-prototype as bars — a breakdown the 3D view has no room to show. It is the same few-shot mechanism that underlies real image and audio classifiers, just made fully explorable at native 2D resolution.

⚙ Under the hood

2D top-down embedding-space map of Prototypical Networks for few-shot learning: drag to pan and scroll to zoom while class prototypes form as the mean of support embeddings, query points get classified by nearest-prototype distance across a live Voronoi decision field, and a per-class accuracy/distance bar panel tracks the result — independently computed from the 3D version's perspective-camera scene.

meta-learningfew-shot-learningprototypical-networksembedding-spaceclassificationmachine-learning

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)