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 global_level_loss_2(self, A_embedding, B_embedding):
      # The item embedding loss of global-level contrastive learning
      f = lambda x: torch.exp(x / self.temperature)
      A_embedding = self.fc3(A_embedding)
      B_embedding = self.fc3(B_embedding)
  
      refl_sim_1 = f(self.sim(A_embedding, A_embedding))
      between_sim_1 = f(self.sim(A_embedding, B_embedding))
      loss_1 = -torch.log(
          between_sim_1.diag()
          / (
              refl_sim_1.sum(1)
              + between_sim_1.sum(1)
              - refl_sim_1.diag()
          )
      )
  
      refl_sim_2 = f(self.sim(B_embedding, B_embedding))
      between_sim_2 = f(self.sim(B_embedding, A_embedding))
      loss_2 = -torch.log(
          between_sim_2.diag()
          / (
              refl_sim_2.sum(1)
              + between_sim_2.sum(1)
              - refl_sim_2.diag()
          )
      )
  
      global_item_loss = (loss_1 + loss_2) * 0.5
      global_item_loss = global_item_loss.mean()
      return global_item_loss
  
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 10 for calling the MCCLK obj's underlying member method code with example usage: obj.global_level_loss_2(A_embedding, B_embedding) and returns: global_item_loss