tensorflow / tensorflow/probability

Feature Request: Vector Quantizer Layer

Open
#463 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
4.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

A recent paper(1) achieving state of the art results on image generation, has sparked a lot of interest in VQ research, but for quite complex architectures (this paper uses a three-stage VQ), making a "layer" abstraction of a VectorQuantizer quite a valuable tool.

Properties of implementation:
Ideally it would work for any dtype/rank tensor.
It should have a call method that is used for training. (or?)
It should have a method to decode discrete tokens, accepting a int32 tensor, looking up codebook
It should have a method to encode continuous latents, that performs the nearest neighbours calculation on the codebook, returning a int32 tensor.

Any more ideas?

  1. Generating Diverse High-Fidelity Images with VQ-VAE-2
    https://arxiv.org/abs/1906.00446v1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the requested VectorQuantizer behavior and the cited VQ-VAE-2 paper. Clarify the layer API and tensor-shape requirements before locating an appropriate TensorFlow Probability entry point. Done means supporting training, encoding continuous latents to int32 tokens, and decoding tokens through a codebook across the requested tensor dtypes and ranks.

Written by the indexing model from the issue text.

Assessment

Tech stack
tensorflow
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.