code: def __init__(self, num_classes, centers_per_class, **kwargs):
      super().__init__(**kwargs)
      assert centers_per_class > 1
      c_f.assert_distance_type(self, CosineSimilarity)
      self.set_class_masks(num_classes, centers_per_class)
      self.add_to_recordable_attributes(
          list_of_names=["num_classes", "centers_per_class"],
          is_stat=False,
      )
      self.add_to_recordable_attributes(
          list_of_names=[
              "same_class_center_sim",
              "diff_class_center_sim",
          ],
          is_stat=True,
      )
  
file_path: pytorch-metric-learning/src/pytorch_metric_learning/regularizers/sparse_centers_regularizer.py
imports: import torch
  from ..distances import CosineSimilarity
  from ..reducers import DivisorReducer
  from ..utils import common_functions
  from .base_regularizer import BaseRegularizer
label_desc: Use image node_id 1 to create a new SparseCentersRegularizer object from inherited base classes: BaseRegularizer with example: obj = SparseCentersRegularizer(num_classes, centers_per_class)