easygraph.model.hypergraphs.hnhn module#

class easygraph.model.hypergraphs.hnhn.HNHN(*args: Any, **kwargs: Any)[source]#

Bases: Module

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

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

  • hid_channels (int) – \(C_{hid}\) is the number of hidden channels.

  • num_classes (int) – The Number of class of the classification task.

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

  • drop_rate (float, optional) – Dropout ratio. Defaults to 0.5.

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

The forward function.

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

  • hg (eg.Hypergraph) – The hypergraph structure that contains \(N\) vertices.