Hypersage#
HyperSAGE Layer.
- class topomodelx.nn.hypergraph.hypersage.HyperSAGE(in_channels, hidden_channels, n_layers=2, alpha=-1, **kwargs)[source]#
Neural network implementation of HyperSAGE [1] for hypergraph classification.
- Parameters:
- in_channelsint
Dimension of the input features.
- hidden_channelsint
Dimension of the hidden features.
- n_layersint, default = 2
Amount of message passing layers.
- alphaint, default = -1
Max number of nodes in a neighborhood to consider. If -1 it considers all the nodes.
- **kwargsoptional
Additional arguments for the inner layers.
References
[1]Arya, Gupta, Rudinac and Worring. HyperSAGE: Generalizing inductive representation learning on hypergraphs (2020). https://arxiv.org/abs/2010.04558
- forward(x_0, incidence_1)[source]#
Forward computation through layers, then linear layer, then global max pooling.
- Parameters:
- x_0torch.Tensor, shape = (n_nodes, features_nodes)
Edge features.
- incidence_1torch.Tensor, shape = (n_nodes, n_edges)
Boundary matrix of rank 1.
- Returns:
- torch.Tensor, shape = (1)
Label assigned to whole complex.