code: def __init__(self, num_tokens, codebook_dim, decay=0.99, eps=1e-5):
      super().__init__()
      self.decay = decay
      self.eps = eps
      weight = torch.randn(num_tokens, codebook_dim)
      self.weight = nn.Parameter(weight, requires_grad=False)
      self.cluster_size = nn.Parameter(
          torch.zeros(num_tokens), requires_grad=False
      )
      self.embed_avg = nn.Parameter(weight.clone(), requires_grad=False)
      self.update = True
  
imports: import logging
  from abc import abstractmethod
  from typing import Dict, Iterator, Literal, Optional, Tuple, Union
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from einops import rearrange
  from torch import einsum
  from .base import AbstractRegularizer, measure_perplexity
label_desc: Use image node_id 1 to create a new EmbeddingEMA object from inherited base classes: nn with example: obj = EmbeddingEMA(num_tokens, codebook_dim, decay, eps)