class_docstr: CORE is a simple and effective framewor, which unifies the representation spac
  for both the encoding and decoding processes in session-based recommendation.
class_docstr_tok: ["CORE","is","a","simple","and","effective","framewor",",","which","unifies","the","representation","spac","for","both","the","encoding","and","decoding","processes","in","session-based","recommendation","."]
code: def __init__(self, config, dataset):
      super(CORE, self).__init__(config, dataset)
  
      # load parameters info
      self.embedding_size = config["embedding_size"]
      self.loss_type = config["loss_type"]
  
      self.dnn_type = config["dnn_type"]
      self.sess_dropout = nn.Dropout(config["sess_dropout"])
      self.item_dropout = nn.Dropout(config["item_dropout"])
      self.temperature = config["temperature"]
  
      # item embedding
      self.item_embedding = nn.Embedding(
          self.n_items, self.embedding_size, padding_idx=0
      )
  
      # DNN
      if self.dnn_type == "trm":
          self.net = TransNet(config, dataset)
      elif self.dnn_type == "ave":
          self.net = self.ave_net
      else:
          raise ValueError(
              f"dnn_type should be either trm or ave, but have [{self.dnn_type}]."
          )
  
      if self.loss_type == "CE":
          self.loss_fct = nn.CrossEntropyLoss()
      else:
          raise NotImplementedError("Make sure 'loss_type' in ['CE']!")
  
      # parameters initialization
      self._reset_parameters()
  
imports: import numpy
  import torch
  from torch import nn
  import torch.nn.functional
  from recbole.model.abstract_recommender import SequentialRecommender
  from recbole.model.layers import TransformerEncoder
label_desc: Use image node_id 1 to create a new CORE object from inherited base classes: SequentialRecommender with example: obj = CORE(config, dataset)