easygraph.model.hypergraphs.hwnn module#

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

Bases: Module

The HWNN model proposed in Heterogeneous Hypergraph Embedding for Graph Classification paper (WSDM 2021).

Parameters:
  • in_channels (int) – Number of input feature channels. \(C_{in}\) is the dimension of input features.

  • num_classes (int) – Number of target classes for classification.

  • ncount (int) – Total number of nodes in the hypergraph.

  • hyper_snapshot_num (int, optional) – number of sementic snapshots for the given heterogeneous hypergraph.

  • hid_channels (int, optional) – Number of hidden units. \(C_{hid}\) is the dimension of hidden representations. Defaults to 128.

  • drop_rate (float, optional) – Dropout probability for regularization. Defaults to 0.01.

forward(X: torch.Tensor, hgs: list) 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.

  • hgs (list of Hypergraph) – A list of hypergraph structures whcih stands for snapshots.