easygraph.model.hypergraphs.unignn module#

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

Bases: Module

The UniGAT model proposed in UniGNN: a Unified Framework for Graph and Hypergraph Neural Networks paper (IJCAI 2021).

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.

  • num_heads (int) – The Number of attention head in each layer.

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

  • drop_rate (float) – The dropout probability. Defaults to 0.5.

  • atten_neg_slope (float) – Hyper-parameter of the LeakyReLU activation of edge attention. Defaults to 0.2.

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.

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

Bases: Module

The UniGCN model proposed in UniGNN: a Unified Framework for Graph and Hypergraph Neural Networks paper (IJCAI 2021).

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.

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

Bases: Module

The UniGIN model proposed in UniGNN: a Unified Framework for Graph and Hypergraph Neural Networks paper (IJCAI 2021).

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.

  • eps (float) – The epsilon value. Defaults to 0.0.

  • train_eps (bool) – If set to True, the epsilon value will be trainable. Defaults to False.

  • 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.

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

Bases: Module

The UniSAGE model proposed in UniGNN: a Unified Framework for Graph and Hypergraph Neural Networks paper (IJCAI 2021).

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.