GIN

class dhg.models.GIN(*args, **kwargs)[source]

Bases: torch.nn.Module

The GIN model proposed in How Powerful are Graph Neural Networks? paper (ICLR 2019).

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_layers (int) – The number of layers in the GIN model. In the original code, it is set to 5.

  • num_mlp_layers (int) – The number of layers in the MLP. Defaults to 2.

  • 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) – The dropout ratio. Defaults to 0.5.

forward(X, g)[source]

The forward function.

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

  • g (dhg.Graph) – The graph structure that contains \(N\) vertices.