gammagl.layers.conv.HypergraphConv

class HypergraphConv(in_channels, out_channels, ea_len, use_attention=False, heads=1, concat=True, negative_slope=0.2, dropout=0.0, bias=True, **kwargs)[source]
reset_parameters()[source]
forward(x, hyperedge_index, hyperedge_weight, hyperedge_attr)[source]
message(x, edge_index, alpha, y, edge_weight=None)[source]

Function that construct message from source nodes to destination nodes.

Parameters:
  • x (tensor) – input node feature.

  • edge_index (tensor) – edges from src to dst.

  • edge_weight (tensor, optional) – weight of each edge.

Returns:

  • tensor – output message

  • Returns – the message matrix, and the shape is [num_edges, message_dim]

aggregate(msg, edge_index, num_nodes=None, aggr='sum')[source]

Function that aggregates message from edges to destination nodes.

Parameters:
  • msg (tensor) – message construct by message function.

  • edge_index (tensor) – edges from src to dst.

  • num_nodes (int, optional) – number of nodes of the graph.

  • aggr (str, optional) – aggregation type, default = ‘sum’, optional=[‘sum’, ‘mean’, ‘max’].

Returns:

aggregation outcome.

Return type:

tensor