class_docstr: A scheduler for vector quantized diffusion.
  
  This model inherits from [`SchedulerMixin`] and [`ConfigMixin`]. Check the superclass documentation for the generic
  methods the library implements for all schedulers such as loading and saving.
  
  Args:
      num_vec_classes (`int`):
          The number of classes of the vector embeddings of the latent pixels. Includes the class for the masked
          latent pixel.
      num_train_timesteps (`int`, defaults to 100):
          The number of diffusion steps to train the model.
      alpha_cum_start (`float`, defaults to 0.99999):
          The starting cumulative alpha value.
      alpha_cum_end (`float`, defaults to 0.00009):
          The ending cumulative alpha value.
      gamma_cum_start (`float`, defaults to 0.00009):
          The starting cumulative gamma value.
      gamma_cum_end (`float`, defaults to 0.99999):
          The ending cumulative gamma value.
code: def __init__(
      self,
      num_vec_classes: int,
      num_train_timesteps: int = 100,
      alpha_cum_start: float = 0.99999,
      alpha_cum_end: float = 0.000009,
      gamma_cum_start: float = 0.000009,
      gamma_cum_end: float = 0.99999,
  ):
      self.num_embed = num_vec_classes
  
      # By convention, the index for the mask class is the last class index
      self.mask_class = self.num_embed - 1
  
      at, att = alpha_schedules(
          num_train_timesteps,
          alpha_cum_start=alpha_cum_start,
          alpha_cum_end=alpha_cum_end,
      )
      ct, ctt = gamma_schedules(
          num_train_timesteps,
          gamma_cum_start=gamma_cum_start,
          gamma_cum_end=gamma_cum_end,
      )
  
      num_non_mask_classes = self.num_embed - 1
      bt = (1 - at - ct) / num_non_mask_classes
      btt = (1 - att - ctt) / num_non_mask_classes
  
      at = torch.tensor(at.astype("float64"))
      bt = torch.tensor(bt.astype("float64"))
      ct = torch.tensor(ct.astype("float64"))
      log_at = torch.log(at)
      log_bt = torch.log(bt)
      log_ct = torch.log(ct)
  
      att = torch.tensor(att.astype("float64"))
      btt = torch.tensor(btt.astype("float64"))
      ctt = torch.tensor(ctt.astype("float64"))
      log_cumprod_at = torch.log(att)
      log_cumprod_bt = torch.log(btt)
      log_cumprod_ct = torch.log(ctt)
  
      self.log_at = log_at.float()
      self.log_bt = log_bt.float()
      self.log_ct = log_ct.float()
      self.log_cumprod_at = log_cumprod_at.float()
      self.log_cumprod_bt = log_cumprod_bt.float()
      self.log_cumprod_ct = log_cumprod_ct.float()
  
      # setable values
      self.num_inference_steps = None
      self.timesteps = torch.from_numpy(
          np.arange(0, num_train_timesteps)[::-1].copy()
      )
  
imports: from dataclasses import dataclass
  from typing import Optional, Tuple, Union
  import numpy
  import torch
  import torch.nn.functional
  from ..configuration_utils import ConfigMixin, register_to_config
  from ..utils import BaseOutput
  from .scheduling_utils import SchedulerMixin
label_desc: Use image node_id 1 to create a new VQDiffusionScheduler object from inherited base classes: SchedulerMixin, ConfigMixin with example: obj = VQDiffusionScheduler(num_vec_classes, num_train_timesteps, alpha_cum_start, alpha_cum_end, gamma_cum_start, gamma_cum_end)