class_docstr: NAIS is an attention network, which is capable of distinguishing which historical items
  in a user profile are more important for a prediction. We just implement the model following
  the original author with a pointwise training mode.
  
  Note:
      instead of forming a minibatch as all training instances of a randomly sampled user which is
      mentioned in the original paper, we still train the model by a randomly sampled interactions.
code: def __init__(self, config, dataset):
      super(NAIS, self).__init__(config, dataset)
  
      # load dataset info
      self.LABEL = config["LABEL_FIELD"]
  
      # get all users' history interaction information.the history item
      # matrix is padding by the maximum number of a user's interactions
      (
          self.history_item_matrix,
          self.history_lens,
          self.mask_mat,
      ) = self.get_history_info(dataset)
  
      # load parameters info
      self.embedding_size = config["embedding_size"]
      self.weight_size = config["weight_size"]
      self.algorithm = config["algorithm"]
      self.reg_weights = config["reg_weights"]
      self.alpha = config["alpha"]
      self.beta = config["beta"]
      self.split_to = config["split_to"]
      self.pretrain_path = config["pretrain_path"]
  
      # split the too large dataset into the specified pieces
      if self.split_to > 0:
          self.logger.info(
              "split the n_items to {} pieces".format(self.split_to)
          )
          self.group = torch.chunk(
              torch.arange(self.n_items).to(self.device), self.split_to
          )
      else:
          self.logger.warning(
              "Pay Attetion!! the `split_to` is set to 0. If you catch a OMM error in this case, "
              + "you need to increase it \n\t\t\tuntil the error disappears. For example, "
              + "you can append it in the command line such as `--split_to=5`"
          )
  
      # define layers and loss
      # construct source and destination item embedding matrix
      self.item_src_embedding = nn.Embedding(
          self.n_items, self.embedding_size, padding_idx=0
      )
      self.item_dst_embedding = nn.Embedding(
          self.n_items, self.embedding_size, padding_idx=0
      )
      self.bias = nn.Parameter(torch.zeros(self.n_items))
      if self.algorithm == "concat":
          self.mlp_layers = MLPLayers(
              [self.embedding_size * 2, self.weight_size]
          )
      elif self.algorithm == "prod":
          self.mlp_layers = MLPLayers(
              [self.embedding_size, self.weight_size]
          )
      else:
          raise ValueError(
              "NAIS just support attention type in ['concat', 'prod'] but get {}".format(
                  self.algorithm
              )
          )
      self.weight_layer = nn.Parameter(torch.ones(self.weight_size, 1))
      self.bceloss = nn.BCEWithLogitsLoss()
  
      # parameters initialization
      if self.pretrain_path is not None:
          self.logger.info(
              "use pretrain from [{}]...".format(self.pretrain_path)
          )
          self._load_pretrain()
      else:
          self.logger.info("unused pretrain...")
          self.apply(self._init_weights)
  
imports: import torch
  import torch.nn
  from torch.nn.init import constant_, normal_, xavier_normal_
  from recbole.model.abstract_recommender import GeneralRecommender
  from recbole.model.layers import MLPLayers
  from recbole.utils import InputType
label_desc: Use image node_id 1 to create a new NAIS object from inherited base classes: GeneralRecommender with example: obj = NAIS(config, dataset)