lucidrains/vector-quantize-pytorch

Vector (and Scalar) Quantization, in Pytorch

61
/ 100
Established

Provides multiple VQ variants including Residual VQ (stacking quantizers to compress residuals), Grouped Residual VQ (applying quantization to feature dimension groups), and k-means initialization for codebook setup. Uses exponential moving average dictionary updates with techniques to combat dead codebook entries: lower-dimensional codebooks, cosine similarity matching, stale code expiration, and orthogonal regularization. Supports both straight-through estimators and the rotation trick for gradient flow, integrating seamlessly into PyTorch models for image and audio generation tasks.

3,878 stars. Actively maintained with 3 commits in the last 30 days.

No Package No Dependents
Maintenance 16 / 25
Adoption 10 / 25
Maturity 16 / 25
Community 19 / 25

How are scores calculated?

Stars

3,878

Forks

320

Language

Python

License

MIT

Last pushed

Mar 26, 2026

Commits (30d)

3

Get this data via API

curl "https://pt-edge.onrender.com/api/v1/quality/ml-frameworks/lucidrains/vector-quantize-pytorch"

Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.