class_docstr: Graph Convolutional Network
class_docstr_tok: ["Graph","Convolutional","Network"]
code: def __init__(
      self,
      config,
      embedding_size,
      n_relations,
      edge_index,
      edge_type,
      inter_matrix,
      device,
  ):
      super(GraphConv, self).__init__()
  
      # load parameters info
      self.n_relations = n_relations
      self.edge_index = edge_index
      self.edge_type = edge_type
      self.inter_matrix = inter_matrix
      self.embedding_size = embedding_size
      self.n_hops = config["n_hops"]
      self.node_dropout_rate = config["node_dropout_rate"]
      self.mess_dropout_rate = config["mess_dropout_rate"]
      self.topk = config["k"]
      self.lambda_coeff = config["lambda_coeff"]
      self.build_graph_separately = config["build_graph_separately"]
      self.device = device
  
      # define layers
      self.relation_embedding = nn.Embedding(
          self.n_relations, self.embedding_size
      )
  
      # User a separate GCN to build item-item graph
      if self.build_graph_separately:
          r"""
          In the original author's implementation(https://github.com/CCIIPLab/MCCLK), the process of constructing
          k-Nearest-Neighbor item-item semantic graph(section 4.1 in paper) and encoding structural view(section 4.3.1 in paper)
          are combined. This implementation improves the computational efficiency, but is slightly different from the
          model structure described in the paper. We use the parameter `build_graph_separately` to control whether to
          use a separate GCN to build a item-item semantic graph. If `build_graph_separately` is set to true, the model
          structure will be the same as that described in the paper. Otherwise, the author's code implementation will be followed.
          """
          self.bg_convs = nn.ModuleList()
          for i in range(self.n_hops):
              self.bg_convs.append(
                  Aggregator(item_only=True, attention=False)
              )
  
      self.convs = nn.ModuleList()
      for i in range(self.n_hops):
          self.convs.append(Aggregator())
  
      self.node_dropout = SparseDropout(
          p=self.mess_dropout_rate
      )  # node dropout
      self.mess_dropout = nn.Dropout(
          p=self.mess_dropout_rate
      )  # mess dropout
  
      # 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 GraphConv object from inherited base classes: nn with example: obj = GraphConv(config, embedding_size, n_relations, edge_index, edge_type, inter_matrix, device)