lucidrains/vector-quantize-pytorch
Vector (and Scalar) Quantization, in Pytorch
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.
Stars
3,878
Forks
320
Language
Python
License
MIT
Category
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.
Related frameworks
Xilinx/brevitas
Brevitas: neural network quantization in PyTorch
fastmachinelearning/qonnx
QONNX: Arbitrary-Precision Quantized Neural Networks in ONNX
open-mmlab/mmengine
OpenMMLab Foundational Library for Training Deep Learning Models
google/qkeras
QKeras: a quantization deep learning library for Tensorflow Keras
tensorflow/model-optimization
A toolkit to optimize ML models for deployment for Keras and TensorFlow, including quantization...