class_docstr: FOSSIL uses similarity of the items as main purpose and uses high MC as a way of sequential preference improve of
  ability of sequential recommendation
class_docstr_tok: ["FOSSIL","uses","similarity","of","the","items","as","main","purpose","and","uses","high","MC","as","a","way","of","sequential","preference","improve","of","ability","of","sequential","recommendation"]
code: def __init__(self, config, dataset):
      super(FOSSIL, self).__init__(config, dataset)
  
      # load the dataset information
      self.n_users = dataset.num(self.USER_ID)
      self.device = config["device"]
  
      # load the parameters
      self.embedding_size = config["embedding_size"]
      self.order_len = config["order_len"]
      assert (
          self.order_len <= self.max_seq_length
      ), "order_len can't longer than the max_seq_length"
      self.reg_weight = config["reg_weight"]
      self.alpha = config["alpha"]
  
      # define the layers and loss type
      self.item_embedding = nn.Embedding(
          self.n_items, self.embedding_size, padding_idx=0
      )
      self.user_lambda = nn.Embedding(self.n_users, self.order_len)
      self.lambda_ = nn.Parameter(torch.zeros(self.order_len))
  
      self.loss_type = config["loss_type"]
      if self.loss_type == "BPR":
          self.loss_fct = BPRLoss()
      elif self.loss_type == "CE":
          self.loss_fct = nn.CrossEntropyLoss()
      else:
          raise NotImplementedError(
              "Make sure 'loss_type' in ['BPR', 'CE']!"
          )
  
      # init the parameters of the model
      self.apply(self.init_weights)
  
file_path: RecBole/recbole/model/sequential_recommender/fossil.py
imports: import torch
  import torch.nn
  from torch.nn.init import xavier_normal_
  from recbole.model.abstract_recommender import SequentialRecommender
  from recbole.model.loss import BPRLoss
label_desc: Use image node_id 1 to create a new FOSSIL object from inherited base classes: SequentialRecommender with example: obj = FOSSIL(config, dataset)