class_docstr: ConvNCF is a a new neural network framework for collaborative filtering based on NCF.
  It uses an outer product operation above the embedding layer,
  which results in a semantic-rich interaction map that encodes pairwise correlations between embedding dimensions.
  We carefully design the data interface and use sparse tensor to train and test efficiently.
  We implement the model following the original author with a pairwise training mode.
class_docstr_tok: ["ConvNCF","is","a","a","new","neural","network","framework","for","collaborative","filtering","based","on","NCF",".","It","uses","an","outer","product","operation","above","the","embedding","layer",",","which","results","in","a","semantic-rich","interaction","map","that","encodes","pairwise","correlations","between","embedding","dimensions",".","We","carefully","design","the","data","interface","and","use","sparse","tensor","to","train","and","test","efficiently",".","We","implement","the","model","following","the","original","author","with","a","pairwise","training","mode","."]
code: def __init__(self, config, dataset):
      super(ConvNCF, self).__init__(config, dataset)
  
      # load dataset info
      self.LABEL = config["LABEL_FIELD"]
  
      # load parameters info
      self.embedding_size = config["embedding_size"]
      self.cnn_channels = config["cnn_channels"]
      self.cnn_kernels = config["cnn_kernels"]
      self.cnn_strides = config["cnn_strides"]
      self.dropout_prob = config["dropout_prob"]
      self.regs = config["reg_weights"]
      self.train_method = config["train_method"]
      self.pre_model_path = config["pre_model_path"]
  
      # define layers and loss
      assert self.train_method in ["after_pretrain", "no_pretrain"]
      if self.train_method == "after_pretrain":
          assert self.pre_model_path != ""
          pretrain_state = torch.load(self.pre_model_path)["state_dict"]
          bpr = BPR(config=config, dataset=dataset)
          bpr.load_state_dict(pretrain_state)
          self.user_embedding = copy.deepcopy(bpr.user_embedding)
          self.item_embedding = copy.deepcopy(bpr.item_embedding)
      else:
          self.user_embedding = nn.Embedding(
              self.n_users, self.embedding_size
          )
          self.item_embedding = nn.Embedding(
              self.n_items, self.embedding_size
          )
  
      self.cnn_layers = CNNLayers(
          self.cnn_channels,
          self.cnn_kernels,
          self.cnn_strides,
          activation="relu",
      )
      self.predict_layers = MLPLayers(
          [self.cnn_channels[-1], 1],
          self.dropout_prob,
          activation="none",
      )
      self.loss = ConvNCFBPRLoss()
  
file_path: RecBole/recbole/model/general_recommender/convncf.py
imports: import torch
  import torch.nn
  import copy
  from recbole.model.abstract_recommender import GeneralRecommender
  from recbole.model.layers import MLPLayers, CNNLayers
  from recbole.model.general_recommender.bpr import BPR
  from recbole.utils import InputType
label_desc: Use image node_id 1 to create a new ConvNCF object from inherited base classes: GeneralRecommender with example: obj = ConvNCF(config, dataset)