HyperGCNConv
- class dhg.nn.HyperGCNConv(*args, **kwargs)[source]
Bases:
torch.nn.ModuleThe HyperGCN convolution layer proposed in HyperGCN: A New Method of Training Graph Convolutional Networks on Hypergraphs paper (NeurIPS 2019).
- Parameters
in_channels (
int) – \(C_{in}\) is the number of input channels.out_channels (int) – \(C_{out}\) is the number of output channels.
use_mediator (
str) – Whether to use mediator to transform the hyperedges to edges in the graph. Defaults toFalse.bias (
bool) – If set toFalse, the layer will not learn the bias parameter. Defaults toTrue.use_bn (
bool) – If set toTrue, the layer will use batch normalization. Defaults toFalse.drop_rate (
float) – If set to a positive number, the layer will use dropout. Defaults to0.5.is_last (
bool) – If set toTrue, the layer will not apply the final activation and dropout functions. Defaults toFalse.
- forward(X, hg, cached_g=None)[source]
The forward function.
- Parameters
X (
torch.Tensor) – Input vertex feature matrix. Size \((N, C_{in})\).hg (
dhg.Hypergraph) – The hypergraph structure that contains \(N\) vertices.cached_g (
dhg.Graph) – The pre-transformed graph structure from the hypergraph structure that contains \(N\) vertices. If not provided, the graph structure will be transformed for each forward time. Defaults toNone.