class_docstr: A transformer layer among all nodes in a graph.
class_docstr_tok: ["A","transformer","layer","among","all","nodes","in","a","graph","."]
code: def __init__(
      self,
      input_state_dimension: int,
      key_query_dimension: int,
      value_dimension: int,
      output_dimension: int,
      intermediate_dimension: int,
      num_heads: int,
      dropout_rate: float = 0.0,
      target_reference: str = "all",
      max_num_nodes: int = 250,
  ):
      super().__init__()
  
      self.__num_heads = num_heads
      self.__key_query_dim = key_query_dimension
      self.__value_dim = value_dimension
  
      self.__selfatt_head_transforms = nn.Linear(
          in_features=input_state_dimension,
          out_features=num_heads
          * (2 * key_query_dimension + value_dimension),
          bias=False,
      )
  
      self.__summarization_layer = nn.Linear(
          in_features=num_heads * value_dimension,
          out_features=output_dimension,
          bias=False,
      )
  
      self.__intermediate_layer = nn.Linear(
          in_features=output_dimension,
          out_features=intermediate_dimension,
      )
  
      self.__output_layer = nn.Linear(
          in_features=intermediate_dimension,
          out_features=output_dimension,
      )
  
      self.__layer_norm1 = nn.LayerNorm(output_dimension)
      self.__layer_norm2 = nn.LayerNorm(output_dimension)
      self.__dropout_layer = nn.Dropout(p=dropout_rate)
  
      self.__target_reference = target_reference
      self.__max_num_nodes = max_num_nodes
  
file_path: ptgnn/ptgnn/neuralmodels/gnn/messagepassing/selfattmessagepassing.py
imports: import torch
  from torch import nn
  from torch_scatter import scatter_sum
  from typing import Dict, List, Tuple
  from ptgnn.neuralmodels.gnn.messagepassing.abstractmessagepassing import AbstractMessagePassingLayer
label_desc: Use image node_id 1 to create a new MultiHeadSelfAttentionMessagePassing object from inherited base classes: AbstractMessagePassingLayer with example: obj = MultiHeadSelfAttentionMessagePassing(input_state_dimension, key_query_dimension, value_dimension, output_dimension, intermediate_dimension, num_heads, dropout_rate, target_reference, max_num_nodes)