phlower.nn.EdgeToNodeSum¶
- class phlower.nn.EdgeToNodeSum(support_name, nodes=None)[source]¶
Bases:
IGenericPhlowerCoreModule[IPhlowerLayerParameters,PhlowerTensor],ModuleEdgeToNodeSum sums the edge feature onto the receiver node of each edge:
v_i = sum_k e_kover the edges (i, j) with receiver i. Self-loop edges are ignored.input: ([t,] n_edges, …, f) output: ([t,] n_nodes, …, f)
tis optional.The input must be edge features whose
n_edgesaxis follows the edge ordering of the support, such as the output of EdgeDifference or EdgeGather with the same support.- Parameters:
support_name (str) – Name of the support tensor defining the edges.
nodes (list[int] | None)
Examples
>>> edge_to_node_sum = EdgeToNodeSum(support_name="support") >>> edge_to_node_sum(data, field_data=field_data)
Methods
forward(data, *, field_data, **kwards)forward function which overloads torch.nn.Module
from_setting(setting)Create EdgeToNodeSum 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