code: def __init__(
      self, embedding_regularizer=None, embedding_reg_weight=1, **kwargs
  ):
      self.embedding_regularizer = (
          embedding_regularizer is not None
      )  # hack needed to know whether reg will be in sub-loss names
      super().__init__(**kwargs)
      self.embedding_regularizer = embedding_regularizer
      self.embedding_reg_weight = embedding_reg_weight
      if self.embedding_regularizer is not None:
          self.add_to_recordable_attributes(
              list_of_names=["embedding_reg_weight"], is_stat=False
          )
  
file_path: pytorch-metric-learning/src/pytorch_metric_learning/losses/mixins.py
imports: import torch
  from ..utils import common_functions
label_desc: Use image node_id 1 to create a new EmbeddingRegularizerMixin object  with example: obj = EmbeddingRegularizerMixin(embedding_regularizer, embedding_reg_weight)