class_docstr: PNN calculate inner and outer product of feature embedding.
  You can choose the product option with the parameter of use_inner and use_outer
class_docstr_tok: ["PNN","calculate","inner","and","outer","product","of","feature","embedding",".","You","can","choose","the","product","option","with","the","parameter","of","use_inner","and","use_outer"]
code: def __init__(self, config, dataset):
      super(PNN, self).__init__(config, dataset)
  
      # load parameters info
      self.mlp_hidden_size = config["mlp_hidden_size"]
      self.dropout_prob = config["dropout_prob"]
      self.use_inner = config["use_inner"]
      self.use_outer = config["use_outer"]
      self.reg_weight = config["reg_weight"]
  
      self.num_pair = int(
          self.num_feature_field * (self.num_feature_field - 1) / 2
      )
  
      # define layers and loss
      product_out_dim = self.num_feature_field * self.embedding_size
      if self.use_inner:
          product_out_dim += self.num_pair
          self.inner_product = InnerProductLayer(
              self.num_feature_field, device=self.device
          )
  
      if self.use_outer:
          product_out_dim += self.num_pair
          self.outer_product = OuterProductLayer(
              self.num_feature_field,
              self.embedding_size,
              device=self.device,
          )
      size_list = [product_out_dim] + self.mlp_hidden_size
      self.mlp_layers = MLPLayers(
          size_list, self.dropout_prob, bn=False
      )
      self.predict_layer = nn.Linear(self.mlp_hidden_size[-1], 1)
      self.relu = nn.ReLU()
      self.sigmoid = nn.Sigmoid()
      self.loss = nn.BCEWithLogitsLoss()
  
      # parameters initialization
      self.apply(self._init_weights)
  
imports: import torch
  import torch.nn
  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 PNN object from inherited base classes: ContextRecommender with example: obj = PNN(config, dataset)