phlower.nn.EdgeGather¶
- class phlower.nn.EdgeGather(support_name, nodes=None)[source]¶
Bases:
IGenericPhlowerCoreModule[IPhlowerLayerParameters,PhlowerTensor],ModuleEdgeGather concatenates the nodal features of the two endpoints of each edge:
e_k = [h_i, h_j]for the k-th edge (i, j). Self-loop edges are ignored.input: ([t,] n_nodes, …, f) output: ([t,] n_edges, …, 2 * f)
tis optional.Combined with EdgeDifference and EdgeToNodeSum, this allows message-passing blocks such as MeshGraphNets to be assembled from feature-wise modules like MLP.
- Parameters:
support_name (str) – Name of the support tensor defining the edges.
nodes (list[int] | None)
Examples
>>> edge_gather = EdgeGather(support_name="support") >>> edge_gather(data, field_data=field_data)
Methods
forward(data, *, field_data, **kwards)forward function which overloads torch.nn.Module
from_setting(setting)Create EdgeGather from setting object
Return neural network name
Attributes
T_destinationcall_super_initdump_patchestraining- forward(data, *, field_data, **kwards)[source]¶
forward function which overloads torch.nn.Module
- Parameters:
data (IPhlowerTensorCollections) – IPhlowerTensorCollections data which receives from predecessors
field_data (ISimulationField) – ISimulationField | None Constant information through training or prediction
- Returns:
Tensor object
- Return type:
PhlowerTensor