Updates node features in MetaLayer:
.. math::
u_{i}^{'} = \\phi^{u}(\\rho^{e \\to u}(e), \\rho^{v \\to u}(v), u)
with
.. math::
\\rho^{e \\to u}(e) = \\frac{\\sum_{i,j=1,\\ i \\neq j}^{N} e_{ij}}{N \\cdot (N-1)},\\\\
\\rho^{v \\to u}(e) = \\frac{\\sum_{i=1}^{N} v_{i}}{N},
where :math:`\\phi^{u}` 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): Global features dimension in hidden layers.
nfeat_out_dim (int): Global 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 global features tensor.
:rtype: `Tensor <https://pytorch.org/docs/stable/tensors.html#torch.Tensor>`_
Definition at line 254 of file geometric_layers.py.
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.
Nodes are averaged over graph
Definition at line 332 of file geometric_layers.py.