class_docstr: The graph transformer operator from the `"Masked Label Prediction:
  Unified Message Passing Model for Semi-Supervised Classification"
  <https://arxiv.org/abs/2009.03509>`_ paper.
  
  .. math::
      \mathbf{x}^{\prime}_i = \mathbf{W}_1 \mathbf{x}_i +
      \sum_{j \in \mathcal{N}(i)} \alpha_{i,j} \mathbf{W}_2 \mathbf{x}_{j},
  
  where the attention coefficients :math:`\alpha_{i,j}` are computed via
  multi-head dot product attention:
  
  .. math::
      \alpha_{i,j} = \textrm{softmax} \left(
      \frac{(\mathbf{W}_3\mathbf{x}_i)^{\top} (\mathbf{W}_4\mathbf{x}_j)}
      {\sqrt{d}} \right)
  
  Args:
      in_channels (int or tuple): Size of each input sample, or :obj:`-1` to
          derive the size from the first input(s) to the forward method.
          A tuple corresponds to the sizes of source and target
          dimensionalities.
      out_channels (int): Size of each output sample.
      heads (int, optional): Number of multi-head-attentions.
          (default: :obj:`1`)
      concat (bool, optional): If set to :obj:`False`, the multi-head
          attentions are averaged instead of concatenated.
          (default: :obj:`True`)
      beta (bool, optional): If set, will combine aggregation and
          skip information via
  
          .. math::
              \mathbf{x}^{\prime}_i = \beta_i \mathbf{W}_1 \mathbf{x}_i +
              (1 - \beta_i) \underbrace{\left(\sum_{j \in \mathcal{N}(i)}
              \alpha_{i,j} \mathbf{W}_2 \vec{x}_j \right)}_{=\mathbf{m}_i}
  
          with :math:`\beta_i = \textrm{sigmoid}(\mathbf{w}_5^{\top}
          [ \mathbf{W}_1 \mathbf{x}_i, \mathbf{m}_i, \mathbf{W}_1
          \mathbf{x}_i - \mathbf{m}_i ])` (default: :obj:`False`)
      dropout (float, optional): Dropout probability of the normalized
          attention coefficients which exposes each node to a stochastically
          sampled neighborhood during training. (default: :obj:`0`)
      edge_dim (int, optional): Edge feature dimensionality (in case
          there are any). Edge features are added to the keys after
          linear transformation, that is, prior to computing the
          attention dot product. They are also added to final values
          after the same linear transformation. The model is:
  
          .. math::
              \mathbf{x}^{\prime}_i = \mathbf{W}_1 \mathbf{x}_i +
              \sum_{j \in \mathcal{N}(i)} \alpha_{i,j} \left(
              \mathbf{W}_2 \mathbf{x}_{j} + \mathbf{W}_6 \mathbf{e}_{ij}
              \right),
  
          where the attention coefficients :math:`\alpha_{i,j}` are now
          computed via:
  
          .. math::
              \alpha_{i,j} = \textrm{softmax} \left(
              \frac{(\mathbf{W}_3\mathbf{x}_i)^{\top}
              (\mathbf{W}_4\mathbf{x}_j + \mathbf{W}_6 \mathbf{e}_{ij})}
              {\sqrt{d}} \right)
  
          (default :obj:`None`)
      bias (bool, optional): If set to :obj:`False`, the layer will not learn
          an additive bias. (default: :obj:`True`)
      root_weight (bool, optional): If set to :obj:`False`, the layer will
          not add the transformed root node features to the output and the
          option  :attr:`beta` is set to :obj:`False`. (default: :obj:`True`)
      **kwargs (optional): Additional arguments of
          :class:`torch_geometric.nn.conv.MessagePassing`.
class_docstr_tok: ["The","graph","transformer","operator","from","the","`","``","Masked","Label","Prediction",":","Unified","Message","Passing","Model","for","Semi-Supervised","Classification","''","<","https",":","\/\/arxiv.org\/abs\/2009.03509",">","`","_","paper",".","..","math",":",":","\\mathbf","{","x","}","^","{","\\prime","}","_i","=","\\mathbf","{","W","}","_1","\\mathbf","{","x","}","_i","+","\\sum_","{","j","\\in","\\mathcal","{","N","}","(","i",")","}","\\alpha_","{","i",",","j","}","\\mathbf","{","W","}","_2","\\mathbf","{","x","}","_","{","j","}",",","where","the","attention","coefficients",":","math",":","`","\\alpha_","{","i",",","j","}","`","are","computed","via","multi-head","dot","product","attention",":","..","math",":",":","\\alpha_","{","i",",","j","}","=","\\textrm","{","softmax","}","\\left","(","\\frac","{","(","\\mathbf","{","W","}","_3\\mathbf","{","x","}","_i",")","^","{","\\top","}","(","\\mathbf","{","W","}","_4\\mathbf","{","x","}","_j",")","}","{","\\sqrt","{","d","}","}","\\right",")","Args",":","in_channels","(","int","or","tuple",")",":","Size","of","each","input","sample",",","or",":","obj",":","`","-1","`","to","derive","the","size","from","the","first","input","(","s",")","to","the","forward","method",".","A","tuple","corresponds","to","the","sizes","of","source","and","target","dimensionalities",".","out_channels","(","int",")",":","Size","of","each","output","sample",".","heads","(","int",",","optional",")",":","Number","of","multi-head-attentions",".","(","default",":",":","obj",":","`","1","`",")","concat","(","bool",",","optional",")",":","If","set","to",":","obj",":","`","False","`",",","the","multi-head","attentions","are","averaged","instead","of","concatenated",".","(","default",":",":","obj",":","`","True","`",")","beta","(","bool",",","optional",")",":","If","set",",","will","combine","aggregation","and","skip","information","via","..","math",":",":","\\mathbf","{","x","}","^","{","\\prime","}","_i","=","\\beta_i","\\mathbf","{","W","}","_1","\\mathbf","{","x","}","_i","+","(","1","-","\\beta_i",")","\\underbrace","{","\\left","(","\\sum_","{","j","\\in","\\mathcal","{","N","}","(","i",")","}","\\alpha_","{","i",",","j","}","\\mathbf","{","W","}","_2","\\vec","{","x","}","_j","\\right",")","}","_","{","=\\mathbf","{","m","}","_i","}","with",":","math",":","`","\\beta_i","=","\\textrm","{","sigmoid","}","(","\\mathbf","{","w","}","_5^","{","\\top","}","[","\\mathbf","{","W","}","_1","\\mathbf","{","x","}","_i",",","\\mathbf","{","m","}","_i",",","\\mathbf","{","W","}","_1","\\mathbf","{","x","}","_i","-","\\mathbf","{","m","}","_i","]",")","`","(","default",":",":","obj",":","`","False","`",")","dropout","(","float",",","optional",")",":","Dropout","probability","of","the","normalized","attention","coefficients","which","exposes","each","node","to","a","stochastically","sampled","neighborhood","during","training",".","(","default",":",":","obj",":","`","0","`",")","edge_dim","(","int",",","optional",")",":","Edge","feature","dimensionality","(","in","case","there","are","any",")",".","Edge","features","are","added","to","the","keys","after","linear","transformation",",","that","is",",","prior","to","computing","the","attention","dot","product",".","They","are","also","added","to","final","values","after","the","same","linear","transformation",".","The","model","is",":","..","math",":",":","\\mathbf","{","x","}","^","{","\\prime","}","_i","=","\\mathbf","{","W","}","_1","\\mathbf","{","x","}","_i","+","\\sum_","{","j","\\in","\\mathcal","{","N","}","(","i",")","}","\\alpha_","{","i",",","j","}","\\left","(","\\mathbf","{","W","}","_2","\\mathbf","{","x","}","_","{","j","}","+","\\mathbf","{","W","}","_6","\\mathbf","{","e","}","_","{","ij","}","\\right",")",",","where","the","attention","coefficients",":","math",":","`","\\alpha_","{","i",",","j","}","`","are","now","computed","via",":","..","math",":",":","\\alpha_","{","i",",","j","}","=","\\textrm","{","softmax","}","\\left","(","\\frac","{","(","\\mathbf","{","W","}","_3\\mathbf","{","x","}","_i",")","^","{","\\top","}","(","\\mathbf","{","W","}","_4\\mathbf","{","x","}","_j","+","\\mathbf","{","W","}","_6","\\mathbf","{","e","}","_","{","ij","}",")","}","{","\\sqrt","{","d","}","}","\\right",")","(","default",":","obj",":","`","None","`",")","bias","(","bool",",","optional",")",":","If","set","to",":","obj",":","`","False","`",",","the","layer","will","not","learn","an","additive","bias",".","(","default",":",":","obj",":","`","True","`",")","root_weight","(","bool",",","optional",")",":","If","set","to",":","obj",":","`","False","`",",","the","layer","will","not","add","the","transformed","root","node","features","to","the","output","and","the","option",":","attr",":","`","beta","`","is","set","to",":","obj",":","`","False","`",".","(","default",":",":","obj",":","`","True","`",")","*","*","kwargs","(","optional",")",":","Additional","arguments","of",":","class",":","`","torch_geometric.nn.conv.MessagePassing","`","."]
code: def reset_parameters(self):
      super().reset_parameters()
      self.lin_key.reset_parameters()
      self.lin_query.reset_parameters()
      self.lin_value.reset_parameters()
      if self.edge_dim:
          self.lin_edge.reset_parameters()
      self.lin_skip.reset_parameters()
      if self.beta:
          self.lin_beta.reset_parameters()
  
file_path: pytorch_geometric/torch_geometric/nn/conv/transformer_conv.py
imports: import math
  import typing
  from typing import Optional, Tuple, Union
  import torch
  import torch.nn.functional
  from torch import Tensor
  from torch_geometric.nn.conv import MessagePassing
  from torch_geometric.nn.dense.linear import Linear
  from torch_geometric.typing import Adj, NoneType, OptTensor, PairTensor, SparseTensor
  from torch_geometric.utils import softmax
label_desc: Use image node_id 2 for calling the TransformerConv obj's underlying member method code with example usage: obj.reset_parameters() without return types