class_docstr: This is an extension of SASRec, which concatenates item representations and item attribute representations
  as the input to the model.
class_docstr_tok: ["This","is","an","extension","of","SASRec",",","which","concatenates","item","representations","and","item","attribute","representations","as","the","input","to","the","model","."]
code: def __init__(self, config, dataset):
      super(SASRecF, self).__init__(config, dataset)
  
      # load parameters info
      self.n_layers = config["n_layers"]
      self.n_heads = config["n_heads"]
      self.hidden_size = config["hidden_size"]  # same as embedding_size
      self.inner_size = config[
          "inner_size"
      ]  # the dimensionality in feed-forward layer
      self.hidden_dropout_prob = config["hidden_dropout_prob"]
      self.attn_dropout_prob = config["attn_dropout_prob"]
      self.hidden_act = config["hidden_act"]
      self.layer_norm_eps = config["layer_norm_eps"]
  
      self.selected_features = config["selected_features"]
      self.pooling_mode = config["pooling_mode"]
      self.device = config["device"]
      self.num_feature_field = sum(
          1
          if dataset.field2type[field] != FeatureType.FLOAT_SEQ
          else dataset.num(field)
          for field in config["selected_features"]
      )
  
      self.initializer_range = config["initializer_range"]
      self.loss_type = config["loss_type"]
  
      # define layers and loss
      self.item_embedding = nn.Embedding(
          self.n_items, self.hidden_size, padding_idx=0
      )
      self.position_embedding = nn.Embedding(
          self.max_seq_length, self.hidden_size
      )
      self.feature_embed_layer = FeatureSeqEmbLayer(
          dataset,
          self.hidden_size,
          self.selected_features,
          self.pooling_mode,
          self.device,
      )
  
      self.trm_encoder = TransformerEncoder(
          n_layers=self.n_layers,
          n_heads=self.n_heads,
          hidden_size=self.hidden_size,
          inner_size=self.inner_size,
          hidden_dropout_prob=self.hidden_dropout_prob,
          attn_dropout_prob=self.attn_dropout_prob,
          hidden_act=self.hidden_act,
          layer_norm_eps=self.layer_norm_eps,
      )
  
      self.concat_layer = nn.Linear(
          self.hidden_size * (1 + self.num_feature_field),
          self.hidden_size,
      )
  
      self.LayerNorm = nn.LayerNorm(
          self.hidden_size, eps=self.layer_norm_eps
      )
      self.dropout = nn.Dropout(self.hidden_dropout_prob)
  
      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']!"
          )
  
      # parameters initialization
      self.apply(self._init_weights)
      self.other_parameter_name = ["feature_embed_layer"]
  
file_path: RecBole/recbole/model/sequential_recommender/sasrecf.py
imports: import torch
  from torch import nn
  from recbole.model.abstract_recommender import SequentialRecommender
  from recbole.model.layers import TransformerEncoder, FeatureSeqEmbLayer
  from recbole.model.loss import BPRLoss
  from recbole.utils import FeatureType
label_desc: Use image node_id 1 to create a new SASRecF object from inherited base classes: SequentialRecommender with example: obj = SASRecF(config, dataset)