Belle II Software  light-2403-persian
NodeLayer Class Reference
Inheritance diagram for NodeLayer:
Collaboration diagram for NodeLayer:

Public Member Functions

def __init__ (self, nfeat_in_dim, efeat_in_dim, gfeat_in_dim, nfeat_hid_dim, nfeat_out_dim, num_hid_layers, dropout, normalize=True)
 
def forward (self, x, edge_index, edge_attr, u, batch)
 

Public Attributes

 nonlin_function
 Non-linear activation.
 
 num_hid_layers
 Number of hidden layers.
 
 dropout_prob
 Dropout probability.
 
 normalize
 Normalize.
 
 lin_in
 Input linear layer.
 
 lins_hid
 Intermediate linear layers.
 
 lin_out
 Output linear layer.
 
 norm
 Batch normalization.
 

Detailed Description

Updates node features in MetaLayer:

.. math::
    v_{i}^{'} = \\phi^{v}(v_{i}, \\rho^{e \\to v}(v_{i}), u)

with

.. math::
    \\rho^{e \\to v}(v_{i}) = \\frac{\\sum_{j=1,\\ j \\neq i}^{N} (e_{ji} + e _{ij})}{2 \\cdot (N-1)},

where :math:`\\phi^{v}` is a neural network of the form

.. figure:: figs/MLP_structure.png
    :width: 42em
    :align: center

Args:
    nfeat_in_dim (int): Node features input dimension (number of node features in input).
    efeat_in_dim (int): Edge features input dimension (number of edge features in input).
    gfeat_in_dim (int): Gloabl features input dimension (number of global features in input).
    nfeat_hid_dim (int): Node features dimension in hidden layers.
    nfeat_out_dim (int): Node features output dimension.
    num_hid_layers (int): Number of hidden layers.
    dropout (float): Dropout rate :math:`r \\in [0,1]`.
    normalize (str): Type of normalization (batch/layer).

:return: Updated node features tensor.
:rtype: `Tensor <https://pytorch.org/docs/stable/tensors.html#torch.Tensor>`_

Definition at line 137 of file geometric_layers.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  nfeat_in_dim,
  efeat_in_dim,
  gfeat_in_dim,
  nfeat_hid_dim,
  nfeat_out_dim,
  num_hid_layers,
  dropout,
  normalize = True 
)
Initialization.

Definition at line 169 of file geometric_layers.py.

Member Function Documentation

◆ forward()

def forward (   self,
  x,
  edge_index,
  edge_attr,
  u,
  batch 
)
Called internally by PyTorch to propagate the input through the network.
 - x: [N, F_x], where N is the number of nodes.
 - edge_index: [2, E] with max entry N - 1.
 - edge_attr: [E, F_e]
 - u: [B, F_u]
 - batch: [N] with max entry B - 1.

Edge labels are averaged (dim_size = N: number of nodes in the graph)

Definition at line 214 of file geometric_layers.py.


The documentation for this class was generated from the following file: