← all builds

shell-vq live demo

2D demo of shelled vector quantization: points form 3 radius shells, each shell gets 8 codebook entries + its own LS scale, and outer-shell vectors get a gated 1-bit residual refinement.

Flat VQ MSE
–
Shelled MSE
–
Refined MSE
–
Shelled cut vs flat
–
Refine drop (outer)
–

Scatter: points colored by shell, ✕ = codebook (8 per shell)

inner mid outer

How it works

1. Shells: point norms are split by quantiles t1=Q(q), t2=Q(1−q) into inner / mid / outer. 2. Codebook: 8 unit directions per shell × per-shell LS scale s=Σv·c/Σc·c (mirrors shell_vq/core.py: quantize_shelled). 3. Residual refine: outer vectors get m·sign(residual) with m=mean|r|, applied only if it strictly reduces that vector's error (mirrors residual_refine).

Code folder: github.com/DastanZar/shell-vq · portfolio card