openhgnn.layers.GeneralLinear

class GeneralLinear(in_features, out_features, act=None, dropout=0.0, has_l2norm=True, has_bn=True, **kwargs)[source]

General Linear, combined with activation, normalization(batch and L2), dropout and so on.

Parameters:
  • in_features (int) – size of each input sample, which is fed into nn.Linear

  • out_features (int) – size of each output sample, which is fed into nn.Linear

  • act (callable activation function/layer or None, optional) – If not None, applies an activation function to the updated node features. Default: None.

  • dropout (float, optional) – Dropout rate. Default: 0.0

  • has_l2norm (bool) – If True, applies torch.nn.functional.normalize to the node features at last of forward(). Default: True

  • has_bn (bool) – If True, applies torch.nn.BatchNorm1d to the node features after applying nn.Linear.