class_docstr: MCCLK is a knowledge-based recommendation model.
  It focuses on the contrastive learning in KG-aware recommendation and proposes a novel multi-level cross-view
  contrastive learning mechanism. This model comprehensively considers three different graph views for KG-aware
  recommendation, including global-level structural view, local-level collaborative and semantic views. It hence
  performs contrastive learning across three views on both local and global levels, mining comprehensive graph
  feature and structure information in a self-supervised manner.
class_docstr_tok: ["MCCLK","is","a","knowledge-based","recommendation","model",".","It","focuses","on","the","contrastive","learning","in","KG-aware","recommendation","and","proposes","a","novel","multi-level","cross-view","contrastive","learning","mechanism",".","This","model","comprehensively","considers","three","different","graph","views","for","KG-aware","recommendation",",","including","global-level","structural","view",",","local-level","collaborative","and","semantic","views",".","It","hence","performs","contrastive","learning","across","three","views","on","both","local","and","global","levels",",","mining","comprehensive","graph","feature","and","structure","information","in","a","self-supervised","manner","."]
code: def __init__(self, config, dataset):
      super(MCCLK, self).__init__(config, dataset)
  
      # load parameters info
      self.embedding_size = config["embedding_size"]
      self.reg_weight = config["reg_weight"]
      self.lightgcn_layer = config["lightgcn_layer"]
      self.item_agg_layer = config["item_agg_layer"]
      self.temperature = config["temperature"]
      self.alpha = config["alpha"]
      self.beta = config["beta"]
      self.loss_type = config["loss_type"]
  
      # load dataset info
      self.inter_matrix = dataset.inter_matrix(form="coo").astype(
          np.float32
      )  # [n_users, n_items]
      # inter_matrix: [n_users, n_entities]; inter_graph: [n_users + n_entities, n_users + n_entities]
      self.inter_matrix, self.inter_graph = self.get_norm_inter_matrix(
          mode="si"
      )
      self.kg_graph = dataset.kg_graph(
          form="coo", value_field="relation_id"
      )  # [n_entities, n_entities]
      # edge_index: [2, -1]; edge_type: [-1,]
      self.edge_index, self.edge_type = self.get_edges(self.kg_graph)
  
      # define layers
      self.user_embedding = nn.Embedding(
          self.n_users, self.embedding_size
      )
      self.entity_embedding = nn.Embedding(
          self.n_entities, self.embedding_size
      )
      self.gcn = GraphConv(
          config=config,
          embedding_size=self.embedding_size,
          n_relations=self.n_relations,
          edge_index=self.edge_index,
          edge_type=self.edge_type,
          inter_matrix=self.inter_matrix,
          device=self.device,
      )
      self.fc1 = nn.Sequential(
          nn.Linear(
              self.embedding_size, self.embedding_size, bias=True
          ),
          nn.ReLU(),
          nn.Linear(
              self.embedding_size, self.embedding_size, bias=True
          ),
      )
      self.fc2 = nn.Sequential(
          nn.Linear(
              self.embedding_size, self.embedding_size, bias=True
          ),
          nn.ReLU(),
          nn.Linear(
              self.embedding_size, self.embedding_size, bias=True
          ),
      )
      self.fc3 = nn.Sequential(
          nn.Linear(
              self.embedding_size, self.embedding_size, bias=True
          ),
          nn.ReLU(),
          nn.Linear(
              self.embedding_size, self.embedding_size, bias=True
          ),
      )
      # define loss
      if self.loss_type.lower() == "bpr":
          self.rec_loss = BPRLoss()
      elif self.loss_type.lower() == "bce":
          self.sigmoid = nn.Sigmoid()
          self.rec_loss = nn.BCEWithLogitsLoss()
      else:
          raise NotImplementedError(
              f"The loss type [{self.loss_type}] has not been supported."
          )
      self.reg_loss = EmbLoss()
  
      # storage variables for full sort evaluation acceleration
      self.restore_user_e = None
      self.restore_item_e = None
  
      # parameters initialization
      self.apply(xavier_normal_initialization)
  
imports: import numpy
  import scipy.sparse
  import torch
  import torch.nn
  import torch.nn.functional
  from recbole.model.abstract_recommender import KnowledgeRecommender
  from recbole.model.init import xavier_normal_initialization
  from recbole.model.layers import SparseDropout
  from recbole.model.loss import BPRLoss, EmbLoss
  from recbole.utils import InputType
label_desc: Use image node_id 1 to create a new MCCLK object from inherited base classes: KnowledgeRecommender with example: obj = MCCLK(config, dataset)