Back to directory

Vector Quantization - Pytorch

A PyTorch library of vector and scalar quantization techniques, transcribed from DeepMind's TensorFlow implementation, used for models such as VQ-VAE-2 and Jukebox.

Vector Quantization - Pytorch

Vector Quantization - Pytorch is a library of vector and scalar quantization methods for PyTorch, originally transcribed from DeepMind's TensorFlow implementation and packaged for convenient reuse. It updates its codebook dictionary using exponential moving averages, and has been used by DeepMind and OpenAI for image generation (VQ-VAE-2) and music generation (Jukebox).

Beyond the base VectorQuantize class, it includes a ResidualVQ class that recursively quantizes the residuals of a signal, with an optional DiVeQ update technique that updates codebooks by gradients instead of auxiliary losses, and a GroupedResidualVQ class that runs residual quantization on separate groups of the feature dimension, matching results reported for Encodec with fewer codebooks. It also supports codebook initialization from k-means centroids of the first batch, and stochastic code sampling with a shared codebook across quantizers.

It installs as a Python package.

More in Libraries

See all 292
  • OpenDecision

    deepanwadhwa.github.io

    An open-source Python package that answers typed questions about application state or documents using a local natural-language-inference model, returning structured choice, score, yes/no or evidence-relation values instead of free text.

  • TradeCanvas

    bonguynvan.github.io

    A zero-dependency canvas charting engine for building TradingView-style trading charts in JavaScript, with 66 technical indicators, 24 drawing tools, 17 chart types, and real-time streaming.

  • 3d retro graphics

    3d-retro.com

    A free, CC0-licensed library of copy-paste retro 3D and demoscene graphics effects, such as plasma, raytracing, and voxel terrain, runnable as WebGL 1 or plain 2D canvas.