class_docstr: RepeatNet explores a hybrid encoder with an repeat module and explore module
  repeat module is used for finding out the repeat consume in sequential recommendation
  explore module is used for exploring new items for recommendation
class_docstr_tok: ["RepeatNet","explores","a","hybrid","encoder","with","an","repeat","module","and","explore","module","repeat","module","is","used","for","finding","out","the","repeat","consume","in","sequential","recommendation","explore","module","is","used","for","exploring","new","items","for","recommendation"]
code: def __init__(self, config, dataset):
      super(RepeatNet, self).__init__(config, dataset)
  
      # load the dataset information
      self.device = config["device"]
  
      # load parameters
      self.embedding_size = config["embedding_size"]
      self.hidden_size = config["hidden_size"]
      self.joint_train = config["joint_train"]
      self.dropout_prob = config["dropout_prob"]
  
      # define the layers and loss function
      self.item_matrix = nn.Embedding(
          self.n_items, self.embedding_size, padding_idx=0
      )
      self.gru = nn.GRU(
          self.embedding_size, self.hidden_size, batch_first=True
      )
      self.repeat_explore_mechanism = Repeat_Explore_Mechanism(
          self.device,
          hidden_size=self.hidden_size,
          seq_len=self.max_seq_length,
          dropout_prob=self.dropout_prob,
      )
      self.repeat_recommendation_decoder = (
          Repeat_Recommendation_Decoder(
              self.device,
              hidden_size=self.hidden_size,
              seq_len=self.max_seq_length,
              num_item=self.n_items,
              dropout_prob=self.dropout_prob,
          )
      )
      self.explore_recommendation_decoder = (
          Explore_Recommendation_Decoder(
              hidden_size=self.hidden_size,
              seq_len=self.max_seq_length,
              num_item=self.n_items,
              device=self.device,
              dropout_prob=self.dropout_prob,
          )
      )
  
      self.loss_fct = F.nll_loss
  
      # init the weight of the module
      self.apply(self._init_weights)
  
imports: import torch
  from torch import nn
  from torch.nn import functional
  from torch.nn.init import xavier_normal_, constant_
  from recbole.model.abstract_recommender import SequentialRecommender
  from recbole.utils import InputType
label_desc: Use image node_id 1 to create a new RepeatNet object from inherited base classes: SequentialRecommender with example: obj = RepeatNet(config, dataset)