Home▸AI & Machine Learning▸t-SNE Perplexity Lab (2D)

t-SNE Perplexity Lab (2D)

2D t-SNE lab: a real gradient-descent embedding running live in the browser, with a neighbor-affinity graph overlay and a KL-divergence sparkline so you can watch perplexity reshape which points count as neighbors.

AI & Machine Learning2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-tsne-perplexity-cluster-visualisation-explained-lab ↗ Open standalone

This 2D companion runs the exact same live t-SNE gradient descent as the 3D original — real per-point Gaussian affinities in 5D solved for a target perplexity, a Student-t distribution in the 2D map, and honest gradient-descent updates every frame — but draws it straight onto the map plane instead of a rotating 3D scene. Two things a camera makes hard to read become directly visible: a neighbor-affinity graph draws a line between any two points whose symmetrized high-dimensional probability clears a threshold, so you can see exactly which pairs the optimiser is trying to pull together, and a live KL-divergence sparkline tracks convergence speed as you change perplexity, cluster separation, cluster count or the learning rate.

⚙ Under the hood

2D t-SNE lab with a real running gradient descent, a neighbor-affinity graph overlay and a KL-divergence sparkline, so perplexity's effect on cluster structure is visible without a 3D camera.

t-snedimensionality reductiongradient descentkl divergenceclusteringmanifold learning

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

What did you find?

Add reproduction steps (optional)