UniSAGE class.

class topomodelx.nn.hypergraph.unisage.UniSAGE(in_channels, hidden_channels, input_drop=0.2, layer_drop=0.2, n_layers=2, e_aggr: Literal['sum', 'mean'] = 'sum', v_aggr: Literal['sum', 'mean'] = 'mean', use_norm: bool = False, **kwargs)[source]#

Neural network implementation of UniSAGE [1] for hypergraph classification.

Parameters:
in_channelsint

Dimension of the input features.

hidden_channelsint

Dimension of the hidden features.

input_dropfloat, default=0.2

Dropout rate for the input features.

layer_dropfloat, default=0.2

Dropout rate for the hidden features.

n_layersint, default = 2

Amount of message passing layers.

e_aggrLiteral[“sum”, “mean”,], default=”sum”

Aggregator function for hyperedges.

v_aggrLiteral[“sum”, “mean”,], default=”mean”

Aggregator function for nodes.

use_normbool

Whether to apply row normalization after every layer.

**kwargsoptional

Additional arguments for the inner layers.

References

[1]

Huang and Yang. UniGNN: a unified framework for graph and hypergraph neural networks. IJCAI 2021. https://arxiv.org/pdf/2105.00956.pdf

forward(x_0, incidence_1)[source]#

Forward computation through layers, then linear layer, then global max pooling.

Parameters:
x_0torch.Tensor, shape = (n_edges, channels_edge)

Edge features.

incidence_1torch.Tensor, shape = (n_nodes, n_edges)

Boundary matrix of rank 1.

Returns:
x_0torch.Tensor

Output node features.

x_1torch.Tensor

Output hyperedge features.