A big innovation in VQ-VAE is to find the gradient of discrete values, called Straight-Through Estimator , which is an optimization technique after introducing variable discretization.
For example, y = arg min f(x), this operation has no gradient, so the previous parameters cannot be updated, so the introduction of Straight-Through Estimator can solve this problem ingeniously.
Specific reference: https://spaces.ac.cn/archives/6760