class_docstr: AutoInt is a novel CTR prediction model based on self-attention mechanism,
  which can automatically learn high-order feature interactions in an explicit fashion.
class_docstr_tok: ["AutoInt","is","a","novel","CTR","prediction","model","based","on","self-attention","mechanism",",","which","can","automatically","learn","high-order","feature","interactions","in","an","explicit","fashion","."]
code: def __init__(self, config, dataset):
      super(AutoInt, self).__init__(config, dataset)
  
      # load parameters info
      self.attention_size = config["attention_size"]
      self.dropout_probs = config["dropout_probs"]
      self.n_layers = config["n_layers"]
      self.num_heads = config["num_heads"]
      self.mlp_hidden_size = config["mlp_hidden_size"]
      self.has_residual = config["has_residual"]
  
      # define layers and loss
      self.att_embedding = nn.Linear(
          self.embedding_size, self.attention_size
      )
      self.embed_output_dim = (
          self.num_feature_field * self.embedding_size
      )
      self.atten_output_dim = (
          self.num_feature_field * self.attention_size
      )
      size_list = [self.embed_output_dim] + self.mlp_hidden_size
      self.mlp_layers = MLPLayers(
          size_list, dropout=self.dropout_probs[1]
      )
      # multi-head self-attention network
      self.self_attns = nn.ModuleList(
          [
              nn.MultiheadAttention(
                  self.attention_size,
                  self.num_heads,
                  dropout=self.dropout_probs[0],
              )
              for _ in range(self.n_layers)
          ]
      )
      self.attn_fc = torch.nn.Linear(self.atten_output_dim, 1)
      self.deep_predict_layer = nn.Linear(self.mlp_hidden_size[-1], 1)
      if self.has_residual:
          self.v_res_embedding = torch.nn.Linear(
              self.embedding_size, self.attention_size
          )
  
      self.dropout_layer = nn.Dropout(p=self.dropout_probs[2])
      self.sigmoid = nn.Sigmoid()
      self.loss = nn.BCEWithLogitsLoss()
  
      # parameters initialization
      self.apply(self._init_weights)
  
file_path: RecBole/recbole/model/context_aware_recommender/autoint.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from torch.nn.init import xavier_normal_, constant_
  from recbole.model.abstract_recommender import ContextRecommender
  from recbole.model.layers import MLPLayers
label_desc: Use image node_id 1 to create a new AutoInt object from inherited base classes: ContextRecommender with example: obj = AutoInt(config, dataset)