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.
docstr: layers of attention which support `prod` and `concat`
  
  Args:
      inter (torch.Tensor): the embedding of history items
      target (torch.Tensor): the embedding of target items
  
  Returns:
      torch.Tensor: the result of attention
docstr_tok: ["layers","of","attention","which","support","`","prod","`","and","`","concat","`","Args",":","inter","(","torch.Tensor",")",":","the","embedding","of","history","items","target","(","torch.Tensor",")",":","the","embedding","of","target","items","Returns",":","torch.Tensor",":","the","result","of","attention"]
code: def attention_mlp(self, inter, target):
      """layers of attention which support `prod` and `concat`
  
      Args:
          inter (torch.Tensor): the embedding of history items
          target (torch.Tensor): the embedding of target items
  
      Returns:
          torch.Tensor: the result of attention
  
      """
      if self.algorithm == "prod":
          mlp_input = inter * target.unsqueeze(
              1
          )  # batch_size x max_len x embedding_size
      else:
          mlp_input = torch.cat(
              [inter, target.unsqueeze(1).expand_as(inter)], dim=2
          )  # batch_size x max_len x embedding_size*2
      mlp_output = self.mlp_layers(
          mlp_input
      )  # batch_size x max_len x weight_size
  
      logits = torch.matmul(mlp_output, self.weight_layer).squeeze(
          2
      )  # batch_size x max_len
      return logits
  
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 6 for calling the NAIS obj's underlying member method code with example usage: obj.attention_mlp(inter, target) and returns: logits