UniGATConv

class dhg.nn.UniGATConv(*args, **kwargs)[source]

Bases: torch.nn.Module

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

Sparse Format:

\[\begin{split}\left\{ \begin{aligned} \alpha_{i e} &=\sigma\left(a^{T}\left[W h_{\{i\}} ; W h_{e}\right]\right) \\ \tilde{\alpha}_{i e} &=\frac{\exp \left(\alpha_{i e}\right)}{\sum_{e^{\prime} \in \tilde{E}_{i}} \exp \left(\alpha_{i e^{\prime}}\right)} \\ \tilde{x}_{i} &=\sum_{e \in \tilde{E}_{i}} \tilde{\alpha}_{i e} W h_{e} \end{aligned} \right. .\end{split}\]
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) – The dropout probability. If dropout <= 0, the layer will not drop values. Defaults to 0.5.

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

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

forward(X, hg)[source]

The forward function.

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

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