easygraph.nn.convs.hypergraphs.hnhn_conv module#

class easygraph.nn.convs.hypergraphs.hnhn_conv.HNHNConv(*args: Any, **kwargs: Any)[source]#

Bases: Module

The HNHN convolution layer proposed in HNHN: Hypergraph Networks with Hyperedge Neurons paper (ICML 2020).

Parameters:
  • in_channels (int) – \(C_{in}\) is the number of input channels.

  • out_channels (int) – \(C_{out}\) is the number of output channels.

  • bias (bool) – If set to False, the layer will not learn the bias parameter. Defaults to True.

  • use_bn (bool) – If set to True, the layer will use batch normalization. Defaults to False.

  • drop_rate (float) – If set to a positive number, the layer will use dropout. Defaults to 0.5.

  • is_last (bool) – If set to True, the layer will not apply the final activation and dropout functions. Defaults to False.

forward(X: torch.Tensor, hg: Hypergraph) torch.Tensor[source]#

The forward function.

Parameters:
  • X (torch.Tensor) – Input vertex feature matrix. Size \((|\mathcal{V}|, C_{in})\).

  • hg (eg.Hypergraph) – The hypergraph structure that contains \(|\mathcal{V}|\) vertices.