class_docstr: TransRec is translation-based model for sequential recommendation.
  It assumes that the `prev. item` + `user`  = `next item`.
  We use the Euclidean Distance to calculate the similarity in this implementation.
class_docstr_tok: ["TransRec","is","translation-based","model","for","sequential","recommendation",".","It","assumes","that","the","`","prev",".","item","`","+","`","user","`","=","`","next","item","`",".","We","use","the","Euclidean","Distance","to","calculate","the","similarity","in","this","implementation","."]
code: def __init__(self, config, dataset):
      super(TransRec, self).__init__(config, dataset)
  
      # load parameters info
      self.embedding_size = config["embedding_size"]
  
      # load dataset info
      self.n_users = dataset.user_num
  
      self.user_embedding = nn.Embedding(
          self.n_users, self.embedding_size, padding_idx=0
      )
      self.item_embedding = nn.Embedding(
          self.n_items, self.embedding_size, padding_idx=0
      )
      self.bias = nn.Embedding(
          self.n_items, 1, padding_idx=0
      )  # Beta popularity bias
      self.T = nn.Parameter(
          torch.zeros(self.embedding_size)
      )  # average user representation 'global'
  
      self.bpr_loss = BPRLoss()
      self.emb_loss = EmbLoss()
      self.reg_loss = RegLoss()
  
      # parameters initialization
      self.apply(xavier_normal_initialization)
  
file_path: RecBole/recbole/model/sequential_recommender/transrec.py
imports: import torch
  from torch import nn
  from recbole.model.abstract_recommender import SequentialRecommender
  from recbole.model.init import xavier_normal_initialization
  from recbole.model.loss import BPRLoss, EmbLoss, RegLoss
  from recbole.utils import InputType
label_desc: Use image node_id 1 to create a new TransRec object from inherited base classes: SequentialRecommender with example: obj = TransRec(config, dataset)