HMPNN#
HMPNN class.
- class topomodelx.nn.hypergraph.hmpnn.HMPNN(in_channels, hidden_channels, n_layers=2, adjacency_dropout_rate=0.7, regular_dropout_rate=0.5, **kwargs)[source]#
Neural network implementation of HMPNN [1].
- Parameters:
- in_channelsint
Dimension of input features.
- hidden_channelsTuple[int]
A tuple of hidden feature dimensions to gradually reduce node/hyperedge representations feature dimension from in_features to the last item in the tuple.
- n_layersint, default = 2
Number of HMPNNLayer layers.
- adjacency_dropout_rateint, default = 0.7
Adjacency dropout rate.
- regular_dropout_rateint, default = 0.5
Regular dropout rate applied on features.
- **kwargsoptional
Additional arguments for the inner layers.
References
[1]Heydari S, Livi L. Message passing neural networks for hypergraphs. ICANN 2022. https://arxiv.org/abs/2203.16995
- forward(x_0, x_1, incidence_1)[source]#
Forward computation through layers.
- Parameters:
- x_0torch.Tensor, shape = (n_nodes, in_features)
Node features.
- x_1torch.Tensor, shape = (n_hyperedges, in_features)
Hyperedge features.
- incidence_1torch.sparse.Tensor, shape = (n_nodes, n_hyperedges)
Incidence matrix (B1).
- Returns:
- x_0torch.Tensor
Output node features.
- x_1torch.Tensor
Output hyperedge features.