class_docstr: NCL is a neighborhood-enriched contrastive learning paradigm for graph collaborative filtering.
  Both structural and semantic neighbors are explicitly captured as contrastive learning objects.
class_docstr_tok: ["NCL","is","a","neighborhood-enriched","contrastive","learning","paradigm","for","graph","collaborative","filtering",".","Both","structural","and","semantic","neighbors","are","explicitly","captured","as","contrastive","learning","objects","."]
code: def e_step(self):
      user_embeddings = (
          self.user_embedding.weight.detach().cpu().numpy()
      )
      item_embeddings = (
          self.item_embedding.weight.detach().cpu().numpy()
      )
      self.user_centroids, self.user_2cluster = self.run_kmeans(
          user_embeddings
      )
      self.item_centroids, self.item_2cluster = self.run_kmeans(
          item_embeddings
      )
  
imports: import numpy
  import scipy.sparse
  import torch
  import torch.nn.functional
  from recbole.model.abstract_recommender import GeneralRecommender
  from recbole.model.init import xavier_uniform_initialization
  from recbole.model.loss import BPRLoss, EmbLoss
  from recbole.utils import InputType
label_desc: Use image node_id 2 for calling the NCL obj's underlying member method code with example usage: obj.e_step() without return types