class_docstr: Creates a vector-quantizer.
  
  It quantizes a continuous vector under a codebook. The codebook is also known
  as "embeddings" or "memory", and it is learned using an exponential moving
  average.
class_docstr_tok: ["Creates","a","vector-quantizer",".","It","quantizes","a","continuous","vector","under","a","codebook",".","The","codebook","is","also","known","as","``","embeddings","''","or","``","memory","''",",","and","it","is","learned","using","an","exponential","moving","average","."]
code: def __init__(self, num_codes, code_size):
      self.num_codes = num_codes
      self.code_size = code_size
      self.codebook = tf.compat.v1.get_variable(
          "codebook",
          [num_codes, code_size],
          dtype=tf.float32,
      )
      self.ema_count = tf.compat.v1.get_variable(
          name="ema_count",
          shape=[num_codes],
          initializer=tf.compat.v1.initializers.constant(0),
          trainable=False,
      )
      self.ema_means = tf.compat.v1.get_variable(
          name="ema_means",
          initializer=self.codebook.initialized_value(),
          trainable=False,
      )
  
imports: import functools
  import os
  import time
  from absl import flags
  from matplotlib import cm
  from matplotlib import figure
  from matplotlib.backends import backend_agg
  import numpy
  from six.moves import urllib
  import tensorflow.compat.v1
  from tensorflow_probability import distributions
  from tensorflow_probability.python.internal import tf_keras
  from tensorflow.contrib.learn.python.learn.datasets import mnist
  from tensorflow.python.training import moving_averages
label_desc: Use image node_id 1 to create a new VectorQuantizer object from inherited base classes: object with example: obj = VectorQuantizer(num_codes, code_size)